What is vrd?
vrd is a free, open-source random number generator library for Rust. It uses Xoshiro256++ by default and adds Mersenne Twister, PCG, ChaCha20 and quasi-random sequences behind Cargo features. See the features.
Is vrd cryptographically secure?
Only with the crypto feature and Random::new_secure(), which uses ChaCha20. The default Xoshiro256++ generator, the Mersenne Twister and PCG are predictable and must not be used for secrets. See the security page.
Does vrd still use the Mersenne Twister?
Not by default. Since 0.0.10, Random::new() uses Xoshiro256++. The Mersenne Twister is still available through Random::new_mersenne_twister() for code that needs MT19937's exact output. See the migration guide.
Which Rust version do I need?
Rust 1.85 or newer. vrd's manifest says 1.70, but the rand 0.10 crate it depends on needs 1.85.
Can I get the same numbers on every run?
Yes. Seed the generator with Random::from_u64_seed or Random::from_seed and it produces the same sequence every time. See reproducible sequences.
Can I share one generator between threads?
No. A Random holds mutable state. Use one per thread, each with its own seed, or split() streams from the default backend.
Does it work without the standard library?
Yes. With default features off, the core builds without std or an allocator; CI checks it for a Cortex-M target and for WebAssembly. Seed it yourself there.
Is the output stable between versions?
The project aims to keep the output for a seed the same between patch releases and lists any change by method in the CHANGELOG. Releases 0.0.10 and 0.0.11 changed the output of int, uint, random_range and normal.
Why is crates.io at 0.0.12 when the repository says 0.0.14?
Versions 0.0.13 and 0.0.14 updated dependencies only and were tagged on GitHub but not published to crates.io. 0.0.12 has the same API.
What does it cost, and under which licence?
Nothing. vrd is free software under the Apache License 2.0 or the MIT licence, at your option.