in csharp/src/Containers/MutableString.cs [787:829]
public MutableString Append(UUID uuid, UUIDPrintFormat format = UUIDPrintFormat.UpperCase)
{
ResetHashCode();
char[] hexDigits = (format == UUIDPrintFormat.LowerCase || format == UUIDPrintFormat.LowerCaseWithoutDashes)
? HexDigitsLower : HexDigitsUpper;
switch (format)
{
case UUIDPrintFormat.LowerCase:
case UUIDPrintFormat.UpperCase:
ulong m = uuid.MSB;
ulong l = uuid.LSB;
for (int i = 15; i > 7; i -= 1)
Append(hexDigits[(int)(m >> (i * 4)) & 0xF]);
Append('-');
for (int i = 7; i > 3; i -= 1)
Append(hexDigits[(int)(m >> (i * 4)) & 0xF]);
Append('-');
for (int i = 3; i >= 0; i -= 1)
Append(hexDigits[(int)(m >> (i * 4)) & 0xF]);
Append('-');
for (int i = 15; i > 11; i -= 1)
Append(hexDigits[(int)(l >> (i * 4)) & 0xF]);
Append('-');
for (int i = 11; i >= 0; i -= 1)
Append(hexDigits[(int)(l >> (i * 4)) & 0xF]);
break;
case UUIDPrintFormat.LowerCaseWithoutDashes:
case UUIDPrintFormat.UpperCaseWithoutDashes:
byte[] bytes = uuid.ToBytes();
foreach (byte b in bytes)
{
int v = b & 0xFF;
Append(hexDigits[v >> 4]);
Append(hexDigits[v & 0x0F]);
}
break;
}
return this;
}