Struct BlockHash
A value type to represent SHA-256 digest of Block data.
Namespace: Libplanet.Types.Blocks
Assembly: Libplanet.Types.dll
Syntax
public readonly struct BlockHash
Constructors
| Improve this Doc View SourceBlockHash(Bencodex.Types.IValue)
A value type to represent SHA-256 digest of Block data.
Declaration
public BlockHash(Bencodex.Types.IValue bencoded)
Parameters
Type | Name | Description |
---|---|---|
Bencodex. |
bencoded |
See Also
| Improve this Doc View SourceBlockHash(in ImmutableArray<Byte>)
Converts an immutable
Declaration
public BlockHash(in ImmutableArray<byte> blockHash)
Parameters
Type | Name | Description |
---|---|---|
Immutable |
blockHash | An immutable |
See Also
| Improve this Doc View SourceBlockHash(Byte[])
Converts a
Declaration
public BlockHash(byte[] blockHash)
Parameters
Type | Name | Description |
---|---|---|
System. |
blockHash | A |
See Also
Fields
| Improve this Doc View SourceSize
The size of bytes that each Block
Declaration
public const int Size = null
Field Value
Type | Description |
---|---|
System. |
See Also
Properties
| Improve this Doc View SourceBencoded
A value type to represent SHA-256 digest of Block data.
Declaration
public readonly Bencodex.Types.IValue Bencoded { get; }
Property Value
Type | Description |
---|---|
Bencodex. |
See Also
| Improve this Doc View SourceByteArray
A bare immutable
Declaration
public readonly ImmutableArray<byte> ByteArray { get; }
Property Value
Type | Description |
---|---|
Immutable |
Remarks
It is immutable. For a mutable array, use To
See Also
Methods
| Improve this Doc View SourceCompareTo(BlockHash)
A value type to represent SHA-256 digest of Block data.
Declaration
public readonly int CompareTo(BlockHash other)
Parameters
Type | Name | Description |
---|---|---|
Block |
other |
Returns
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceCompareTo(Nullable<Object>)
A value type to represent SHA-256 digest of Block data.
Declaration
public readonly int CompareTo(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System. |
obj |
Returns
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceDeriveFrom(IReadOnlyList<Byte>)
Computes a SHA-256 digest from the given blockBytes
.
Declaration
public static BlockHash DeriveFrom(IReadOnlyList<byte> blockBytes)
Parameters
Type | Name | Description |
---|---|---|
IRead |
blockBytes | The bytes serializing a block to compute its hash. |
Returns
Type | Description |
---|---|
Block |
The SHA-256 hash digest derived from |
See Also
| Improve this Doc View SourceEquals(BlockHash)
A value type to represent SHA-256 digest of Block data.
Declaration
public readonly bool Equals(BlockHash other)
Parameters
Type | Name | Description |
---|---|---|
Block |
other |
Returns
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceEquals(Nullable<Object>)
A value type to represent SHA-256 digest of Block data.
Declaration
public override readonly bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System. |
obj |
Returns
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceFromHashDigest(HashDigest<SHA256>)
Converts a given Hash
Declaration
public static BlockHash FromHashDigest(HashDigest<SHA256> hashDigest)
Parameters
Type | Name | Description |
---|---|---|
Hash |
hashDigest | A SHA-256 digest. |
Returns
Type | Description |
---|---|
Block |
A block hash corresponding to the |
See Also
| Improve this Doc View SourceFromString(String)
Converts a given hexadecimal representation of a block hash into
a Block
This is an inverse function of To
Declaration
public static BlockHash FromString(string hex)
Parameters
Type | Name | Description |
---|---|---|
System. |
hex | A hexadecimal representation of a Block |
Returns
See Also
| Improve this Doc View SourceGetHashCode()
A value type to represent SHA-256 digest of Block data.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceGetObjectData(SerializationInfo, StreamingContext)
A value type to represent SHA-256 digest of Block data.
Declaration
public readonly void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
Serialization |
info | |
Streaming |
context |
See Also
| Improve this Doc View SourceToByteArray()
Gets a bare mutable
Declaration
public readonly byte[] ToByteArray()
Returns
Type | Description |
---|---|
System. |
A new mutable |
See Also
| Improve this Doc View SourceToString()
A value type to represent SHA-256 digest of Block data.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
System. |