Created
May 31, 2016 21:47
-
-
Save Silvenga/54d72dc00a446a7d1c3f41f57caa6c35 to your computer and use it in GitHub Desktop.
Convert from GUID to UUID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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