Module ring::rand

source ·
Expand description

Cryptographic pseudo-random number generation.

ring functions that generate random bytes take a &dyn SecureRandom parameter to make it clear which functions are non-deterministic.


  • A random value constructed from a SecureRandom that hasn’t been exposed through any safe Rust interface.
  • A secure random number generator where the random values come directly from the operating system.



  • Generate the new random value using rng.