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

Cleaner random numbers #18

Open
wants to merge 4 commits into
base: 2.0.0-cryptographically-secure-version
Choose a base branch
from

Conversation

rfl890
Copy link

@rfl890 rfl890 commented May 29, 2023

I have changed the cryptoRandom function to create an IEEE 754 double from scratch. It generates 2 random 32-bit unsigned integers using crypto.getRandomValues, and constructs a double from them. IMO this is the closest you can get to constructing a random double, as it fills the whole 53 bits (that it can represent) with random bits.

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

Successfully merging this pull request may close these issues.

1 participant