Skip to main content

sys_rng

Function sys_rng 

Source
pub fn sys_rng() -> impl CryptoRng
Expand description

Returns an infallible handle to the operating system’s entropy source.

Use this whenever randomness must come directly from the OS (e.g. key generation) rather than from a seeded or userspace RNG.

§Panics

Panics if the operating system fails to provide randomness.