Struct TxId
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction<T>'s content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Implements
Inherited Members
Namespace: Libplanet.Tx
Assembly: Libplanet.dll
Syntax
[Serializable]
[Equals]
public struct TxId : ISerializable
Constructors
| Improve this Doc View SourceTxId(Byte[])
Declaration
public TxId(byte[] txid)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | txid | A Byte array that encodes
a TxId. It must not be |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the given
|
ArgumentOutOfRangeException | Thrown when the given
|
TxId(SerializationInfo, StreamingContext)
Declaration
public TxId(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
Fields
| Improve this Doc View SourceSize
Declaration
public const int Size = 32
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceByteArray
Declaration
public ImmutableArray<byte> ByteArray { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Remarks
It is immutable. For a mutable array, use ToByteArray() method instead.
See Also
Methods
| Improve this Doc View SourceGetObjectData(SerializationInfo, StreamingContext)
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
ToByteArray()
Declaration
[Pure]
public byte[] ToByteArray()
Returns
Type | Description |
---|---|
Byte[] | A new mutable Byte array of this TxId. Since a returned array is created every time the method is called, any mutations on that array does not affect to the TxId object. |
See Also
| Improve this Doc View SourceToHex()
Gets a hexadecimal form of a TxId.
Declaration
[Pure]
public string ToHex()
Returns
Type | Description |
---|---|
String | 64 hexadecimal characters. |
ToString()
Gets a TxId's representative string.
Declaration
[Pure]
public override string ToString()
Returns
Type | Description |
---|---|
String | A string which represents this TxId. |