Better guid logging

This commit is contained in:
Marc Hernandez 2025-11-02 16:17:30 -08:00
parent bbef15138c
commit 6b092f8a41

View File

@ -9,7 +9,7 @@ public static class GuidExt
{ {
extension(Guid g) extension(Guid g)
{ {
public string Log => $"{g.LastByte():X}"; public string Log => $"{g.LastUShort():X8}";
} }
public static System.Guid GuidFromLongs( long a, long b ) public static System.Guid GuidFromLongs( long a, long b )
@ -92,6 +92,12 @@ public static class GuidExt
return (a, b, c, d); return (a, b, c, d);
} }
public static ushort LastUShort( this System.Guid guid )
{
var bytes = guid.ToByteArray();
return BitConverter.ToUInt16( bytes, 14 );
}
public static byte LastByte( this System.Guid guid ) public static byte LastByte( this System.Guid guid )
{ {
var bytes = guid.ToByteArray(); var bytes = guid.ToByteArray();