Class Hash
The XRP Ledger has several "hash" types: Hash128, Hash160, and Hash256.
These fields contain arbitrary binary data of the given number of bits, which may or may not represent the result of a hash operation.
All such fields are serialized as the specific number of bits, with no length indicator, in big-endian byte order.
Base class defining how to encode and decode hashes
Implements
Namespace: Xrpl.BinaryCodec.Types
Assembly: Xrpl.BinaryCodec.dll
Syntax
public abstract class Hash : ISerializedType
Constructors
| Edit this page View SourceHash(byte[])
Defines how to construct Hash from buffer
Declaration
protected Hash(byte[] buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | buffer | bytes buffer |
Fields
| Edit this page View SourceBuffer
Bytes buffer
Declaration
public readonly byte[] Buffer
Field Value
| Type | Description |
|---|---|
| byte[] |
Methods
| Edit this page View SourceEquals(Hash)
check hash to equal
Declaration
public bool Equals(Hash other)
Parameters
| Type | Name | Description |
|---|---|---|
| Hash | other | other hash |
Returns
| Type | Description |
|---|---|
| bool |
ToBytes(IBytesSink)
Hash to bytes
Declaration
public void ToBytes(IBytesSink sink)
Parameters
| Type | Name | Description |
|---|---|---|
| IBytesSink | sink | Bytes Sink |
ToJson()
hash to json string
Declaration
public JsonNode ToJson()
Returns
| Type | Description |
|---|---|
| JsonNode |
ToString()
hash to string value
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
object.ToString()
Operators
| Edit this page View Sourceexplicit operator string(Hash)
Declaration
public static explicit operator string(Hash h)
Parameters
| Type | Name | Description |
|---|---|---|
| Hash | h |
Returns
| Type | Description |
|---|---|
| string |