Skip to content

Commit 2569e9d

Browse files
authored
Mention disabling getrandom for wasm32-unknown-unknown in README (#1250)
1 parent 9dd97b4 commit 2569e9d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,13 @@ unavailable.
143143

144144
### WASM support
145145

146-
The WASM target `wasm32-unknown-unknown` is not *automatically* supported by
147-
`rand` or `getrandom`. To solve this, either use a different target such as
148-
`wasm32-wasi` or add a direct dependency on `getrandom` with the `js` feature
149-
(if the target supports JavaScript). See
146+
Seeding entropy from OS on WASM target `wasm32-unknown-unknown` is not
147+
*automatically* supported by `rand` or `getrandom`. If you are fine with
148+
seeding the generator manually, you can disable the `getrandom` feature
149+
and use the methods on the `SeedableRng` trait. To enable seeding from OS,
150+
either use a different target such as `wasm32-wasi` or add a direct
151+
dependency on `getrandom` with the `js` feature (if the target supports
152+
JavaScript). See
150153
[getrandom#WebAssembly support](https://docs.rs/getrandom/latest/getrandom/#webassembly-support).
151154

152155
# License

0 commit comments

Comments
 (0)