Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FromHash() [1/2]

static BlobContentId System.Reflection.Metadata.BlobContentId.FromHash ( byte[] hashCode)
inlinestatic

Definition at line 60 of file BlobContentId.cs.

61 {
62 if (hashCode == null)
63 {
64 throw new ArgumentNullException("hashCode");
65 }
66 if (hashCode.Length < 20)
67 {
68 throw new ArgumentException(System.SR.Format(System.SR.HashTooShort, 20), "hashCode");
69 }
70 uint a = (uint)((hashCode[3] << 24) | (hashCode[2] << 16) | (hashCode[1] << 8) | hashCode[0]);
71 ushort num = (ushort)((hashCode[5] << 8) | hashCode[4]);
72 ushort num2 = (ushort)((hashCode[7] << 8) | hashCode[6]);
73 byte b = hashCode[8];
74 byte e = hashCode[9];
75 byte f = hashCode[10];
76 byte g = hashCode[11];
77 byte h = hashCode[12];
78 byte i = hashCode[13];
79 byte j = hashCode[14];
80 byte k = hashCode[15];
81 num2 = (ushort)((num2 & 0xFFFu) | 0x4000u);
82 b = (byte)((b & 0x3Fu) | 0x80u);
83 Guid guid = new Guid((int)a, (short)num, (short)num2, b, e, f, g, h, i, j, k);
84 uint stamp = 0x80000000u | (uint)((hashCode[19] << 24) | (hashCode[18] << 16) | (hashCode[17] << 8) | hashCode[16]);
85 return new BlobContentId(guid, stamp);
86 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string HashTooShort
Definition SR.cs:214
Definition SR.cs:7

References System.Reflection.Metadata.BlobContentId.BlobContentId(), System.SR.Format(), System.Reflection.Metadata.BlobContentId.Guid, and System.SR.HashTooShort.