This site will run an RNG test. Please be patient
Test complete
Under normal circumstances, the cryptographic generator will be faster than Math.random
because it can generate random numbers in bulk.
On modern processors (under Windows at least) this will be much faster because the CPU has a single instruction for generating random numbers.
Math.random
will only return a single number,
while crypto.getRandomValues
can generate up to 65536 bytes at once.
The WebAssembly method is only limited by the memory it's instantiated with but doesn't utilizes any special CPU features.
For this case, a buffer with 1 million bytes (1 MB) is used.
Bytes per second via cryptographically safe RNG |
Ready |
Bytes per second via Math.random |
Ready |
Bytes per second via WebAssembly |
Ready |