Skip to main content

NetworkHash128

A struct in Root.Township, Alta.Networking.

A 128-bit ID stored as 16 bytes, written and read as a 32 character hex string.

Fields​

MemberWhat it is
byte i0Byte 0, the first two hex characters.
byte i1Byte 1 of the hash.
byte i10Byte 10 of the hash.
byte i11Byte 11 of the hash.
byte i12Byte 12 of the hash.
byte i13Byte 13 of the hash.
byte i14Byte 14 of the hash.
byte i15Byte 15, the last two hex characters.
byte i2Byte 2 of the hash.
byte i3Byte 3 of the hash.
byte i4Byte 4 of the hash.
byte i5Byte 5 of the hash.
byte i6Byte 6 of the hash.
byte i7Byte 7 of the hash.
byte i8Byte 8 of the hash.
byte i9Byte 9 of the hash.

Methods​

MemberWhat it is
bool IsValid()True if any byte is non-zero.
static NetworkHash128 Parse(string text)Reads a hex string, left padding short strings with zeros. Bad characters read as 0.
void Reset()Sets every byte to zero.
override string ToString()The 32 character lowercase hex form.
1 private and internal method
MemberWhat it is
private static int HexToNumber(char c)Turns one hex digit into its number; anything else gives 0. Used by Parse.