Middle Square Weyl Sequence RNG for Rust
A new implementation of John von Neumann's middle square random number generator (RNG). A Weyl sequence is utilized to keep the generator running through a long period.
Using
This library includes a few thread-safe functions.
// generates a random u64
f64 // generates a random f64
fill // fill byte slice with random data
seed // reseed the number generator
u64
There's also a Generator
type in case you need to generate random numbers in
an isolated thread. It's little faster because it avoids mutex locks.
let mut rand = new;
println!; // generates a random u64
Contact
Josh Baker @tidwall
License
Weyl source code is available under the ISC License.