diff --git a/README.md b/README.md index fc539b46eb..6047a1d3b8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Rand is a set of crates supporting (pseudo-)random generators: - Built over a standard RNG trait: [`rand_core::RngCore`](https://docs.rs/rand_core/latest/rand_core/trait.RngCore.html) - With fast implementations of both [strong](https://rust-random.github.io/book/guide-rngs.html#cryptographically-secure-pseudo-random-number-generators-csprngs) and - [small](https://rust-random.github.io/book/guide-rngs.html#basic-pseudo-random-number-generators-prngs) generators: [`rand::rngs`](https://docs.rs/rand/latest/rand/rngs/index.html), and more RNGs: [`rand_chacha`](https://docs.rs/rand_chacha), [`rand_xoshiro`](https://docs.rs/rand_xoshiro/), [`rand_pcg`](https://docs.rs/rand_pcg/), [rngs repo](https://github.com/rust-random/rngs/) + [small](https://rust-random.github.io/book/guide-rngs.html#basic-pseudo-random-number-generators-prngs) generators: [`rand::rngs`](https://docs.rs/rand/latest/rand/rngs/index.html), and more RNGs: [`chacha20`](https://docs.rs/chacha20), [`rand_xoshiro`](https://docs.rs/rand_xoshiro/), [`rand_pcg`](https://docs.rs/rand_pcg/), [`rand_sfc`](https://docs.rs/rand_sfc/), [`rand_seeder`](https://docs.rs/rand_seeder/), [rngs repo](https://github.com/rust-random/rngs/) - [`rand::rng`](https://docs.rs/rand/latest/rand/fn.rng.html) is an asymptotically-fast, automatically-seeded and reasonably strong generator available on all `std` targets - Direct support for seeding generators from the [getrandom] crate @@ -64,13 +64,16 @@ See the [CHANGELOG](https://github.com/rust-random/rand/blob/master/CHANGELOG.md Rand is built with these features enabled by default: - `std` enables functionality dependent on the `std` lib -- `alloc` (implied by `std`) enables functionality requiring an allocator -- `sys_rng` (implied by `std`) enables `rngs::SysRng`, using the [getrandom] crate -- `std_rng` enables inclusion of `StdRng`, `ThreadRng` +- `alloc` (implied by `std`) enables functionality requiring an allocator; a + significant portion of sequence and distribution functionality requires this +- `sys_rng` enables `rand::rngs::SysRng` (uses the [getrandom] crate) +- `std_rng` enables `rand::rngs::StdRng` (uses the [chacha20] crate) +- `thread_rng` (implies `std`, `std_rng`, `sys_rng`) enables `rand::rngs::ThreadRng` and `rand::rng()` Optionally, the following dependencies can be enabled: -- `log` enables logging via [log](https://crates.io/crates/log) +- `chacha` enables `rand::rngs::{ChaCha8Rng, ChaCha12Rng, ChaCha20Rng}` (uses the [chacha20] crate) +- `log` enables logging (uses the [log] crate) Additionally, these features configure Rand: @@ -83,11 +86,6 @@ Additionally, these features configure Rand: Note: enabling this option is expected to affect reproducibility of results. -Rand supports limited functionality in `no_std` mode (enabled via -`default-features = false`). In this case, `SysRng` is -unavailable (unless `sys_rng` is enabled), large parts of `seq` are -unavailable (unless `alloc` is enabled), and `ThreadRng` is unavailable. - ## Portability ### Reproducibility @@ -111,3 +109,5 @@ See [LICENSE-APACHE](https://github.com/rust-random/rand/blob/master/LICENSE-APA [COPYRIGHT](https://github.com/rust-random/rand/blob/master/COPYRIGHT) for details. [getrandom]: https://crates.io/crates/getrandom +[chacha20]: https://crates.io/crates/chacha20 +[log]: https://crates.io/crates/log