Function urandom::csprng

source ·
pub fn csprng() -> Random<impl Rng + Clone>Notable traits for Random<R>impl<R: Rng> Read for Random<R>
Expand description

Creates a new cryptographically secure pseudorandom number generator.

The generator is seeded securely from the system entropy source.

Examples

let mut rng = urandom::csprng();
let value: i32 = rng.next();