Deprecated[src]

Function rand::rng

pub fn rng() -> StdRng

Create a random number generator with a default algorithm and seed.

It returns the strongest Rng algorithm currently implemented in pure Rust. If you require a specifically seeded Rng for consistency over time you should pick one algorithm and create the Rng yourself.

This is a very expensive operation as it has to read randomness from the operating system and use this in an expensive seeding operation. If one does not require high performance generation of random numbers, task_rng and/or random may be more appropriate.