Random Number Generation

Index

random/buf random/buf-deterministic random/ratchet random/reseed random/seed-bytes random/u32 random/uniform

Reference

random/bufcfunction
(random/buf buf &opt size)

Fill a buffer with random bytes. If size is not provided, will clear and fill the given buffer. If size is provided, will append size random bytes to the buffer. Alternatively, you can provide just the size argument, and a new randomized buffer will be returned.

(random/buf-deterministic buf len seed)

Generate len random bytes and push them into a buffer buf. seed is a byte sequence of at least 32 bytes that initializes the state of the RNG. Returns the modified buffer.

(random/ratchet)

Increment the internal state of the RNG.

random/reseedcfunction
(random/reseed)

Provide a new random seed for the internal RNG.

Number of bytes in a seed for the RNG.

random/u32cfunction
(random/u32)

Generate a psuedo random 32 bit unsigned integer

(random/uniform top)

Generate a random 32 bit unsigned integer less than top.