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

◆ ActivitySpanId() [2/2]

unsafe System.Diagnostics.ActivitySpanId.ActivitySpanId ( ReadOnlySpan< byte > idData)
inlineprivate

Definition at line 86 of file ActivitySpanId.cs.

87 {
88 if (idData.Length != 16)
89 {
90 throw new ArgumentOutOfRangeException("idData");
91 }
92 if (!Utf8Parser.TryParse(idData, out ulong value, out int _, 'x'))
93 {
94 _hexString = CreateRandom()._hexString;
95 return;
96 }
97 if (BitConverter.IsLittleEndian)
98 {
100 }
101 _hexString = System.HexConverter.ToString(new ReadOnlySpan<byte>(&value, 8), System.HexConverter.Casing.Lower);
102 }
static sbyte ReverseEndianness(sbyte value)
static bool TryParse(ReadOnlySpan< byte > source, out bool value, out int bytesConsumed, char standardFormat='\0')
static unsafe string ToString(ReadOnlySpan< byte > bytes, Casing casing=Casing.Upper)
static unsafe ActivitySpanId CreateRandom()

References System.Diagnostics.ActivitySpanId._hexString, System.Diagnostics.ActivitySpanId.CreateRandom(), System.BitConverter.IsLittleEndian, System.ReadOnlySpan< T >.Length, System.Buffers.Binary.BinaryPrimitives.ReverseEndianness(), System.HexConverter.ToString(), System.Buffers.Text.Utf8Parser.TryParse(), and System.value.