Function random::init_rng

source ·
pub fn init_rng<T>() -> Result<T, Error>where
    T: SeedableRng,
Expand description

Initialises a T RNG.

Directly accessing the global CSPRNG can be expensive and so it is often better to seed a local PRNG from the global CSPRNG. Using a local PRNG also allows for much faster cryptographically insecure PRNGs to be used.