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

Biased randomNumber function #3

Open
olalonde opened this issue Sep 25, 2019 · 1 comment
Open

Biased randomNumber function #3

olalonde opened this issue Sep 25, 2019 · 1 comment

Comments

@olalonde
Copy link

olalonde commented Sep 25, 2019

Just a heads up: your randomNumber function is biased (so probably not suitable for cryptographic purpose). See http://www.pcg-random.org/posts/bounded-rands.html for details (specifically "FP Multiply (Biased)" section).

I opened a Node.js feature request to get this into the standard library since it's such a common error: nodejs/node#29707

@jsonmaur
Copy link
Owner

Thanks for the heads up. Any idea how we could fix it in the meantime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants