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

◆ TryFormatUInt64X()

static bool System.Buffers.Text.Utf8Formatter.TryFormatUInt64X ( ulong value,
byte precision,
bool useLower,
Span< byte > destination,
out int bytesWritten )
inlinestaticprivate

Definition at line 1052 of file Utf8Formatter.cs.

1053 {
1054 int num = FormattingHelpers.CountHexDigits(value);
1055 int num2 = ((precision == byte.MaxValue) ? num : Math.Max(precision, num));
1056 if (destination.Length < num2)
1057 {
1058 bytesWritten = 0;
1059 return false;
1060 }
1061 bytesWritten = num2;
1062 if (useLower)
1063 {
1064 while ((uint)(--num2) < (uint)destination.Length)
1065 {
1066 destination[num2] = (byte)HexConverter.ToCharLower((int)value);
1067 value >>= 4;
1068 }
1069 }
1070 else
1071 {
1072 while ((uint)(--num2) < (uint)destination.Length)
1073 {
1074 destination[num2] = (byte)HexConverter.ToCharUpper((int)value);
1075 value >>= 4;
1076 }
1077 }
1078 return true;
1079 }

References System.Buffers.Text.FormattingHelpers.CountHexDigits(), System.destination, System.Math.Max(), System.HexConverter.ToCharLower(), System.HexConverter.ToCharUpper(), and System.value.

Referenced by System.Buffers.Text.Utf8Formatter.TryFormatInt64(), and System.Buffers.Text.Utf8Formatter.TryFormatUInt64().