Skip to content

SecureRandom Class ​

Definition ​

Provides a thread safe CRYPTOGRAPHICLY secure Random Number Generator

  • Namespace: JASE
  • Assembly: JASE.dll

Methods ​

NameDescription
bool CoinFlip()Returns true or false with equal probability using a cryptographically secure random source.
int Next(int max)Returns a nonnegative random number less than the specified maximum.
int Next(int min, int max)Returns a random number within a specified range.
byte[] NextBytes(int count)Returns a new array of the specified length filled with random bytes.
void NextBytes(Span<byte> buffer)Fills the elements of a specified array of bytes with random numbers.
double NextDouble()Returns a cryptographically secure random double in the range [0.0, 1.0).
long NextInt64()Returns a nonnegative random number.
long NextInt64(long max)Returns a nonnegative random number.
long NextInt64(long min, long max)Returns a nonnegative random number.