Struct Nonce
An arbitrary Bytes that is used as salt for
deriving
Implements
Inherited Members
Namespace: Libplanet.Common
Assembly: Libplanet.Common.dll
Syntax
[JsonConverter(typeof(NonceJsonConverter))]
public struct Nonce : IEquatable<Nonce>
Constructors
| Improve this Doc View SourceNonce(Byte[])
Converts a Byte array into a Nonce value.
This constructor is an inverse function of ToByteArray() method.
Declaration
public Nonce(byte[] nonce)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | nonce | A Byte array to convert to a Nonce object. It must not be null. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the given
|
See Also
| Improve this Doc View SourceNonce(in ImmutableArray<Byte>)
Converts an immutable Byte array into a Nonce instance.
This constructor is inverse of ByteArray property.
Declaration
public Nonce(in ImmutableArray<byte> nonce)
Parameters
Type | Name | Description |
---|---|---|
ImmutableArray<Byte> | nonce |
See Also
Properties
| Improve this Doc View SourceByteArray
A bare immutable Byte array of the nonce.
Declaration
public readonly 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 SourceEquals(Nonce)
An arbitrary Bytes that is used as salt for
deriving
Declaration
public bool Equals(Nonce other)
Parameters
Type | Name | Description |
---|---|---|
Nonce | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
An arbitrary Bytes that is used as salt for
deriving
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
An arbitrary Bytes that is used as salt for
deriving
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceToByteArray()
Gets a bare mutable Byte array of the nonce.
Declaration
[Pure]
public byte[] ToByteArray()
Returns
Type | Description |
---|---|
Byte[] | A new mutable Byte array of the nonce. Since a returned array is created every time the method is called, any mutations on that array does not affect to the Nonce object. |
See Also
| Improve this Doc View SourceToString()
Gets a hexadecimal representation of a Nonce.
Declaration
[Pure]
public override string ToString()
Returns
Type | Description |
---|---|
String | A hexadecimal representation of a Nonce. |
Overrides
Operators
| Improve this Doc View SourceEquality(Nonce, Nonce)
An arbitrary Bytes that is used as salt for
deriving
Declaration
public static bool operator ==(Nonce left, Nonce right)
Parameters
Type | Name | Description |
---|---|---|
Nonce | left | |
Nonce | right |
Returns
Type | Description |
---|---|
Boolean |
Inequality(Nonce, Nonce)
An arbitrary Bytes that is used as salt for
deriving
Declaration
public static bool operator !=(Nonce left, Nonce right)
Parameters
Type | Name | Description |
---|---|---|
Nonce | left | |
Nonce | right |
Returns
Type | Description |
---|---|
Boolean |