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 other UNIX-like platforms, this reads random bytes from /dev/urandom.

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.

Fields

Methods

impl OsRng { ... }

Mixins

impl OsRng { ... }