Rando.js icon indicating copy to clipboard operation
Rando.js copied to clipboard

Cleaner random numbers

Open rfl890 opened this issue 2 years ago • 0 comments

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.

rfl890 avatar May 29 '23 19:05 rfl890