Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

random

Obtains entropy from a cryptographically secure pseudo-random number generator.

The implementation may store RNG state in process memory and use it to fill buffer.

The randomness is seeded by randomSecure, or a less secure mechanism upon failure.

Threadsafe.

See also randomSecure.

Io.random
pub fn random(io: Io, buffer: []u8) void

File

lib/std/Io.zig:2549

Code

pub fn random(io: Io, buffer: []u8) void {
    return io.vtable.random(io.userdata, buffer);
}