Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getrandom for seeding the RNG on WASM targets #60

Merged
merged 5 commits into from
Jun 5, 2023
Merged

Conversation

notgull
Copy link
Member

@notgull notgull commented May 13, 2023

See this comment. On Web targets with the js feature enabled, the getrandom crate is used to seed the global RNG. When it isn't, it just uses a fixed seed.

Closes #27
Closes #54

@notgull notgull requested a review from taiki-e May 14, 2023 04:07
Cargo.toml Outdated Show resolved Hide resolved
@notgull notgull requested a review from taiki-e June 5, 2023 02:43
Copy link
Collaborator

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@notgull notgull merged commit eb78d89 into master Jun 5, 2023
@notgull notgull deleted the notgull/web-rng branch June 5, 2023 13:39
@taiki-e taiki-e mentioned this pull request Jun 8, 2023
notgull added a commit that referenced this pull request Jun 9, 2023
- **Breaking:** Remove interior mutability from `Rng`. (#47)
- Add a `fork()` method. (#49)
- Add a `no_std` mode. (#50)
- Add an iterator selection function. (#51)
- Add a `choose_multiple()` function for sampling several elements from an iterator. (#55)
- Use the `getrandom` crate for seeding on WebAssembly targets if the `js` feature is enabled. (#60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Use of instant crate imcompatible w/ MIT license? instant needs wasm-bindgen outside of dev
2 participants