You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-7
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Rand is a set of crates supporting (pseudo-)random generators:
12
12
- With fast implementations of both [strong](https://rust-random.github.io/book/guide-rngs.html#cryptographically-secure-pseudo-random-number-generators-csprngs) and
13
13
[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/)
14
14
-[`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
15
-
- Direct support for seeding generators from the [`getrandom` crate](https://crates.io/crates/getrandom)
15
+
- Direct support for seeding generators from the [getrandom] crate
16
16
17
17
With broad support for random value generation and random processes:
18
18
@@ -80,8 +80,7 @@ Rand is built with these features enabled by default:
80
80
81
81
-`std` enables functionality dependent on the `std` lib
82
82
-`alloc` (implied by `std`) enables functionality requiring an allocator
83
-
-`getrandom` (implied by `std`) is an optional dependency providing the code
84
-
behind `rngs::OsRng`
83
+
-`os_rng` (implied by `std`) enables `rngs::OsRng`, using the [getrandom] crate
85
84
-`std_rng` enables inclusion of `StdRng`, `ThreadRng`
86
85
87
86
Optionally, the following dependencies can be enabled:
Rand supports limited functionality in `no_std` mode (enabled via
103
102
`default-features = false`). In this case, `OsRng` and `from_os_rng` are
104
-
unavailable (unless `getrandom` is enabled), large parts of `seq` are
103
+
unavailable (unless `os_rng` is enabled), large parts of `seq` are
105
104
unavailable (unless `alloc` is enabled), and `ThreadRng` is unavailable.
106
105
107
106
## Portability and platform support
108
107
109
108
Many (but not all) algorithms are intended to have reproducible output. Read more in the book: [Portability](https://rust-random.github.io/book/portability.html).
110
109
111
-
The Rand library supports a variety of CPU architectures. Platform integration is outsourced to [getrandom](https://docs.rs/getrandom/latest/getrandom/).
110
+
The Rand library supports a variety of CPU architectures. Platform integration is outsourced to [getrandom].
112
111
113
112
### WASM support
114
113
115
114
Seeding entropy from OS on WASM target `wasm32-unknown-unknown` is not
116
115
*automatically* supported by `rand` or `getrandom`. If you are fine with
117
-
seeding the generator manually, you can disable the `getrandom` feature
116
+
seeding the generator manually, you can disable the `os_rng` feature
118
117
and use the methods on the `SeedableRng` trait. To enable seeding from OS,
119
118
either use a different target such as `wasm32-wasi` or add a direct
120
-
dependency on `getrandom` with the `js` feature (if the target supports
119
+
dependency on [getrandom] with the `js` feature (if the target supports
0 commit comments