This file contains hidden or 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
public static async Task<Guid> NewReallyRandomGuid() | |
{ | |
// Got this value from the 'Create GUID' dialog in Visual | |
// Studio. Guaranteed to be unique. | |
var guid = Guid.Parse("43BB5AE8-653E-4985-88F8-A8C4A92C9BD5").ToByteArray(); | |
//Prevent collisions by XORing with random data | |
byte[] bytes = new byte[16]; | |
var rng = new RNGCryptoServiceProvider(); | |
rng.GetBytes(bytes); |
This file contains hidden or 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
public static Guid NewReallyRandomGuid() | |
{ | |
// Got this value from the 'Create GUID' dialog in Visual | |
// Studio. Guaranteed to be unique. | |
return Guid.Parse("43BB5AE8-653E-4985-88F8-A8C4A92C9BD5"); | |
} |