Module rand

Module rand 

Source
Expand description

Randomness helpers built atop tinyrand, seeded with wall-clock time. Provides a shared RNG for tests and lightweight sampling (non-cryptographic).

Statics§

STD_RAND
Global RNG protected by a mutex, seeded from now_nanos().

Functions§

next_u8
Produce an 8-bit random value (samples from next_u16).
next_u16
Produce a 16-bit random value from the shared RNG.
next_u32
Produce a 32-bit random value from the shared RNG.
next_u64
Produce a 64-bit random value from the shared RNG.
next_u128
Produce a 128-bit random value from the shared RNG.