INNER CODE UNIT · C#
max
sdrapkin/SecurityDriven.Inferno · CryptoRandom.cs:225
const double max = 1L << 53; // https://en.wikipedia.org/wiki/Double-precision_floating-point_format
return ((ulong)GetRandomLong() >> 11) / max;
}//NextDouble()
/// <summary>
/// Returns a new count-sized byte array filled with random bytes.
/// </summary>
/// <param name="count">Array length.</param>
/// <returns>Random byte array.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public byte[] NextBytes(int count)
{
byte[] bytes = new byte[count];
this.NextBytes(bytes, 0, count);
return bytes;
}//NextBytes()
// Inherited from Random. We must override this one to prevent inherited Random.NextBytes from ever getting called.