crypto::random+x86_64 +linux

crypto::random provides a cryptographically secure random number generator, which yields a nondeterministic sequence of random numbers.

If true randomness isn't required for your use case, you may be better off using math::random::'s pseudorandom number generator.

Index

Globals

let stream: *io::stream;

Functions

fn buffer(buf: []u8) void;

Globals

let stream[link]

let stream: *io::stream;

An io::handle which returns cryptographically random data on reads. Be aware, it may return less than you asked for!

Functions

fn buffer[link]

fn buffer(buf: []u8) void;

Fills the given buffer with cryptographically random data. If the system is unable to provide random data, abort. If you need to handle errors or want to use whatever random data the system can provide, even if less than the requested amount, use stream instead.