Use uniformly distributed, cryptographically secure random numbers.
FSMaxB
Branch: FSMaxB/correcthorsebatterystaple:improved-random
Branch: jvdl/correcthorsebatterystaple:master
Merged
Merged pull request
Merged in improved-random (pull request #1)
Merged in improved-random (pull request #1)
This introduces a new function
getUniformRandomInteger
that uses the crypto API and produces uniformly distributed random numbers.It will throw an Error when the crypto API is not available and alert the user (I can change this and fall back to using Math.random() in this case if you want though).