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.