1 #if MONOTOUCH && FULL_AOT_RUNTIME
3 using Crimson.CommonCrypto;
9 public static Guid NewGuid ()
11 byte[] b = new byte [16];
12 Cryptor.GetRandom (b);
14 Guid res = new Guid (b);
15 // Mask in Variant 1-0 in Bit[7..6]
16 res._d = (byte) ((res._d & 0x3fu) | 0x80u);
17 // Mask in Version 4 (random based Guid) in Bits[15..13]
18 res._c = (short) ((res._c & 0x0fffu) | 0x4000u);