Struct MessageId
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Inherited Members
Namespace: Libplanet.Net.Messages
Assembly: Libplanet.Net.dll
Syntax
[Serializable]
public struct MessageId : ISerializable, IComparable<MessageId>, IComparable
Constructors
| Improve this Doc View SourceMessageId(Byte[])
Declaration
public MessageId(byte[] messageId)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | messageId | A Byte array that encodes a MessageId. 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 SourceMessageId(SerializationInfo, StreamingContext)
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public MessageId(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
See Also
Fields
| Improve this Doc View SourceSize
Declaration
public const int Size = 32
Field Value
Type | Description |
---|---|
Int32 |
See Also
Properties
| Improve this Doc View SourceByteArray
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 SourceCompareTo(MessageId)
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public int CompareTo(MessageId other)
Parameters
Type | Name | Description |
---|---|---|
MessageId | other |
Returns
Type | Description |
---|---|
Int32 |
See Also
| Improve this Doc View SourceCompareTo(Object)
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Int32 |
See Also
| Improve this Doc View SourceEquals(MessageId)
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public bool Equals(MessageId other)
Parameters
Type | Name | Description |
---|---|---|
MessageId | other |
Returns
Type | Description |
---|---|
Boolean |
See Also
| Improve this Doc View SourceEquals(Object)
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
See Also
| Improve this Doc View SourceFromHex(String)
Creates a MessageId value from a hex
string.
Declaration
public static MessageId FromHex(string hex)
Parameters
Type | Name | Description |
---|---|---|
String | hex | A hexadecimal string which encodes a MessageId. This has to contain 64 hexadecimal digits and must not be null This is usually made by ToHex() method. |
Returns
Type | Description |
---|---|
MessageId | A corresponding MessageId value. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the given |
ArgumentOutOfRangeException | Thrown when the given
|
FormatException | Thrown when the given |
See Also
| Improve this Doc View SourceGetHashCode()
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
See Also
| Improve this Doc View SourceGetObjectData(SerializationInfo, StreamingContext)
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
See Also
| Improve this Doc View SourceToByteArray()
Declaration
[Pure]
public byte[] ToByteArray()
Returns
Type | Description |
---|---|
Byte[] | A new mutable Byte array of this MessageId. Since a returned array is created every time the method is called, any mutations on that array does not affect to the MessageId object. |
See Also
| Improve this Doc View SourceToHex()
Gets a hexadecimal form of a MessageId.
Declaration
[Pure]
public string ToHex()
Returns
Type | Description |
---|---|
String | 64 hexadecimal characters. |
See Also
| Improve this Doc View SourceToString()
Gets a MessageId's representative string.
Declaration
[Pure]
public override string ToString()
Returns
Type | Description |
---|---|
String | A string which represents this MessageId. |
Overrides
See Also
Operators
| Improve this Doc View SourceEquality(MessageId, MessageId)
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public static bool operator ==(MessageId left, MessageId right)
Parameters
Type | Name | Description |
---|---|---|
MessageId | left | |
MessageId | right |
Returns
Type | Description |
---|---|
Boolean |
See Also
| Improve this Doc View SourceInequality(MessageId, MessageId)
MessageId, abbreviation of message identifier, is a SHA-256 digest derived from a Message's content.
As it is a SHA-256 digest, it consists of 32 Bytes, and 64 characters in hexadecimal. (See also Size constant.)
Declaration
public static bool operator !=(MessageId left, MessageId right)
Parameters
Type | Name | Description |
---|---|---|
MessageId | left | |
MessageId | right |
Returns
Type | Description |
---|---|
Boolean |