Esempio n. 1
0
 //returns a uniformly random ulong between ulong.Min inclusive and ulong.Max inclusive
 public static ulong NextULong(this Random Rng)
 {
     byte[] buf = new byte[8];
     Rng.NextBytes(buf);
     return(BitConverter.ToUInt64(buf, 0));
 }
Esempio n. 2
0
 public static byte[] GetRandomByteArray(Random random, int size)
 {
     byte[] value = new byte[size];
     random.NextBytes(value);
     return(value);
 }