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

◆ DecodeByte()

static byte System.Guid.DecodeByte ( nuint ch1,
nuint ch2,
ref int invalidIfNegative )
inlinestaticprivate

Definition at line 568 of file Guid.cs.

569 {
570 ReadOnlySpan<byte> charToHexLookup = HexConverter.CharToHexLookup;
571 int num = -1;
572 if (ch1 < (nuint)charToHexLookup.Length)
573 {
574 num = (sbyte)Unsafe.Add(ref MemoryMarshal.GetReference(charToHexLookup), (nint)ch1);
575 }
576 num <<= 4;
577 int num2 = -1;
578 if (ch2 < (nuint)charToHexLookup.Length)
579 {
580 num2 = (sbyte)Unsafe.Add(ref MemoryMarshal.GetReference(charToHexLookup), (nint)ch2);
581 }
582 int num3 = num | num2;
583 invalidIfNegative |= num3;
584 return (byte)num3;
585 }

References System.HexConverter.CharToHexLookup, and System.ReadOnlySpan< T >.Length.

Referenced by System.Guid.TryParseExactD(), and System.Guid.TryParseExactN().