Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Generate Secure GUID
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Security.Cryptography; namespace Rextester { public class Program { public static void Main(string[] args) { byte[] bytes = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; using (var rng = new RNGCryptoServiceProvider()) { rng.GetBytes(bytes); } var time = BitConverter.ToUInt32(bytes, 0); var time_mid = BitConverter.ToUInt16(bytes, 4); var time_hi_and_ver = BitConverter.ToUInt16(bytes, 6); time_hi_and_ver = (ushort)((time_hi_and_ver | 0x4000) & 0x4FFF); bytes[8] = (byte)((bytes[8] | 0x80) & 0xBF); var id = new Guid(time, time_mid, time_hi_and_ver, bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] ); Console.WriteLine(id); } } }
run
|
edit
|
history
|
help
0
D113
C# queue
NeedFirst
QuickSort
Gradebook
Interface constraints in generics
kjk
dgd dy retert
sxsadxasxd
testing