Struct std::random::OsRng

struct OsRng { ... }

RNG backed by a OS-provided random number generation facility

On Linux, this is based on libc::getrandom, on MacOS it is based on libc::getentropy.

Usage notes

OsRng is generally considered to be safe to use for cryptographic purposes. However, since it results in a syscall for each operation, it may be too slow when used as a general-purpose RNG.

Good choice for seeding other RNGs.

Example

Methods

impl OsRng { ... }

Mixins

impl OsRng { ... }