WyRand-rs
A fast & portable non-cryptographic pseudorandom number generator written in Rust.
The implementation is based on wyhash, a simple and fast hasher but not cryptographically secure. It's known to be extremely fast and performant while still having great statistical properties.
This crate can be used on its own or be integrated with rand_core/rand, and it is no-std compatible. Minimum compatible Rust version is 1.60.
Example
Generate a random value:
use WyRand;
// Provide a seed to the PRNG
let mut rng = new;
let value = rng.rand;
Features
The crate will always export WyRand and will do so when set as default-features = false in the Cargo.toml. By default, it will have the rand_core & debug features enabled.
rand_core- Enables support forrand_core, implementingRngCore&SeedableRngonWyRand.debug- Enablescore::fmt::Debugimplementation forWyRand.serde1- EnablesSerializeandDeserializederives onWyRand.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.