Show / Hide Table of Contents

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.)

Implements
ISerializable
IComparable<MessageId>
IComparable
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.ReferenceEquals(Object, Object)
Namespace: Libplanet.Net.Messages
Assembly: Libplanet.Net.dll
Syntax
[Serializable]
public struct MessageId : ISerializable, IComparable<MessageId>, IComparable

Constructors

| Improve this Doc View Source

MessageId(Byte[])

Converts a Byte array into a MessageId.

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 messageId's Length is not the same to the required Size.

See Also
Id
| Improve this Doc View Source

MessageId(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
Id

Fields

| Improve this Doc View Source

Size

The Bytes size that each MessageId takes.

As a message ID is a SHA-256 digest, it is 32 Bytes.

Declaration
public const int Size = 32
Field Value
Type Description
Int32
See Also
Id

Properties

| Improve this Doc View Source

ByteArray

A bare immutable Byte array of this MessageId.

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
ToByteArray()

Methods

| Improve this Doc View Source

CompareTo(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
Id
| Improve this Doc View Source

CompareTo(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
Id
| Improve this Doc View Source

Equals(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
Id
| Improve this Doc View Source

Equals(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
ValueType.Equals(Object)
See Also
Id
| Improve this Doc View Source

FromHex(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 hex string is null.

ArgumentOutOfRangeException

Thrown when the given hex is shorter or longer than 64 characters.

FormatException

Thrown when the given hex string is not a valid hexadecimal string.

See Also
ToHex()
| Improve this Doc View Source

GetHashCode()

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
ValueType.GetHashCode()
See Also
Id
| Improve this Doc View Source

GetObjectData(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
Id
| Improve this Doc View Source

ToByteArray()

Gets a bare mutable Byte array of this MessageId.

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
ByteArray
| Improve this Doc View Source

ToHex()

Gets a hexadecimal form of a MessageId.

Declaration
[Pure]
public string ToHex()
Returns
Type Description
String

64 hexadecimal characters.

See Also
Id
| Improve this Doc View Source

ToString()

Gets a MessageId's representative string.

Declaration
[Pure]
public override string ToString()
Returns
Type Description
String

A string which represents this MessageId.

Overrides
ValueType.ToString()
See Also
Id

Operators

| Improve this Doc View Source

Equality(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
Id
| Improve this Doc View Source

Inequality(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
Id

Implements

System.Runtime.Serialization.ISerializable
System.IComparable<T>
System.IComparable

See Also

Id
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium