Module rand

Source
Expand description

Miscellaneous functions related to getting (pseudo) random numbers and strings.

NOTE! This should not be used when you do need real random numbers such as for encryption but will probably be suitable when you want locally unique ID’s that will not be shared over the network.

Functions§

rand_alphanumerics
Gets a pseudo random OsString of length len with characters in the range [a-zA-Z0-9].
rand_bytes
Get a pseudo random vector of len bytes.
timestamp_cycles
Gets an ever increasing u64 (at least for this process).
xor_pseudo_rng_u32
Generate pseudo random u32 numbers based on the current timestamp.