Struct TxId
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Implements
Inherited Members
Namespace: Libplanet.Types.Tx
Assembly: Libplanet.Types.dll
Syntax
[Serializable]
[JsonConverter(typeof(TxIdJsonConverter))]
public readonly struct TxId : ISerializable, IEquatable<TxId>, IComparable<TxId>, IComparable, IBencodable
Constructors
| Improve this Doc View SourceTxId(IValue)
Creates a TxId instance from given bencoded
.
Declaration
public TxId(IValue bencoded)
Parameters
Type | Name | Description |
---|---|---|
Bencodex.Types.IValue | bencoded | A Bencodex Bencodex.Types.Binary of 32 System.Bytes which represents an TxId. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when given |
See Also
| Improve this Doc View SourceTxId(Byte[])
Converts a mutable System.Byte array into a TxId.
Declaration
public TxId(byte[] txid)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | txid | A mutable System.Byte array that encodes a TxId. It must not be null, and its Length must be the same to Size. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the given
|
See Also
| Improve this Doc View SourceTxId(in ImmutableArray<Byte>)
Converts an immutable System.Byte array into a TxId.
Declaration
public TxId(in ImmutableArray<byte> txid)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Immutable.ImmutableArray<System.Byte> | txid | An immutable System.Byte array that encodes a TxId. It must not be null, and its Length must be the same to Size. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the given
|
See Also
| Improve this Doc View SourceTxId(SerializationInfo, StreamingContext)
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public TxId(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
See Also
Fields
| Improve this Doc View SourceSize
The System.Bytes size that each TxId takes.
As a txid is a SHA-256 digest, it is 32 System.Bytes.
Declaration
public const int Size = 32
Field Value
Type | Description |
---|---|
Int32 |
See Also
Properties
| Improve this Doc View SourceBencoded
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public readonly IValue Bencoded { get; }
Property Value
Type | Description |
---|---|
Bencodex.Types.IValue |
See Also
| Improve this Doc View SourceByteArray
A bare immutable System.Byte array of this TxId.
Declaration
public readonly ImmutableArray<byte> ByteArray { get; }
Property Value
Type | Description |
---|---|
System.Collections.Immutable.ImmutableArray<System.Byte> |
Remarks
It is immutable. For a mutable array, use ToByteArray() method instead.
See Also
Methods
| Improve this Doc View SourceCompareTo(TxId)
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public readonly int CompareTo(TxId other)
Parameters
Type | Name | Description |
---|---|---|
TxId | other |
Returns
Type | Description |
---|---|
Int32 |
See Also
| Improve this Doc View SourceCompareTo(Object)
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public readonly int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Int32 |
See Also
| Improve this Doc View SourceEquals(TxId)
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public readonly bool Equals(TxId other)
Parameters
Type | Name | Description |
---|---|---|
TxId | other |
Returns
Type | Description |
---|---|
System.Boolean |
See Also
| Improve this Doc View SourceEquals(Object)
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
See Also
| Improve this Doc View SourceFromHex(String)
Creates a TxId value from a hex
string.
Declaration
public static TxId FromHex(string hex)
Parameters
Type | Name | Description |
---|---|---|
String | hex | A hexadecimal string which encodes a TxId. This has to contain 64 hexadecimal digits and must not be null This is usually made by ToHex() method. |
Returns
Type | Description |
---|---|
TxId | A corresponding TxId value. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the given
|
FormatException | Thrown when the given |
See Also
| Improve this Doc View SourceGetHashCode()
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
See Also
| Improve this Doc View SourceGetObjectData(SerializationInfo, StreamingContext)
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public readonly void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
See Also
| Improve this Doc View SourceToByteArray()
Gets a bare mutable System.Byte array of this TxId.
Declaration
[Pure]
public readonly byte[] ToByteArray()
Returns
Type | Description |
---|---|
System.Byte[] | A new mutable System.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 readonly string ToHex()
Returns
Type | Description |
---|---|
String | 64 hexadecimal characters. |
See Also
| Improve this Doc View SourceToString()
Gets a TxId's representative string.
Declaration
[Pure]
public override readonly string ToString()
Returns
Type | Description |
---|---|
String | A string which represents this TxId. |
Overrides
See Also
Operators
| Improve this Doc View SourceEquality(TxId, TxId)
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public static bool operator ==(TxId left, TxId right)
Parameters
Type | Name | Description |
---|---|---|
TxId | left | |
TxId | right |
Returns
Type | Description |
---|---|
System.Boolean |
See Also
| Improve this Doc View SourceInequality(TxId, TxId)
TxId, abbreviation of transaction identifier, is a SHA-256 digest derived from a Transaction's content.
As it is a SHA-256 digest, it consists of 32 System.Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public static bool operator !=(TxId left, TxId right)
Parameters
Type | Name | Description |
---|---|---|
TxId | left | |
TxId | right |
Returns
Type | Description |
---|---|
System.Boolean |