Skip to content

Instantly share code, notes, and snippets.

@Silvenga
Created May 31, 2016 21:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Convert from GUID to UUID
var guid = Guid.Parse("10a5be07-e2ba-46fa-bb18-273f77dc39f0");
var b = guid.ToByteArray();
var mirror = guid.ToByteArray();
b[0] = mirror[3];
b[1] = mirror[2];
b[2] = mirror[1];
b[3] = mirror[0];
b[4] = mirror[5];
b[5] = mirror[4];
b[6] = mirror[7];
b[7] = mirror[6];
foreach (var byt in b)
{
Console.Write("{0:X2}", byt);
}
Console.WriteLine();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment