Skip to content

Instantly share code, notes, and snippets.

View PaulStovell's full-sized avatar

Paul Stovell PaulStovell

View GitHub Profile
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);
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");
}