// 0 <= x < 1 public static double GenerateDouble_From0To1() { // 48 bits var bytes = RandomData.GenerateBytes(8); bytes[6] = 0; bytes[7] = 0; var l = BitConverter.ToInt64(bytes, 0); return(l / Power_2_48); }
public string NewBytes_Base64(int length) { var data = RandomData.GenerateBytes(length); return(Convert.ToBase64String(data)); }
public string NewBytes_HexUpper(int length) { var data = RandomData.GenerateBytes(length); return(data.ToHexString(true)); }
public static double GenerateDouble() { var bytes = RandomData.GenerateBytes(8); return(BitConverter.ToDouble(bytes, 0)); }
public static long GenerateInt64() { var bytes = RandomData.GenerateBytes(8); return(BitConverter.ToInt64(bytes, 0)); }
public static int GenerateInt32() { var bytes = RandomData.GenerateBytes(4); return(BitConverter.ToInt32(bytes, 0)); }
public static byte GenerateByte() { var bytes = RandomData.GenerateBytes(1); return(bytes[0]); }