Skip to content

Instantly share code, notes, and snippets.

@mr21
Created July 5, 2018 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mr21/03eb4074ca18be8b64c52429a871e33b to your computer and use it in GitHub Desktop.
Save mr21/03eb4074ca18be8b64c52429a871e33b to your computer and use it in GitHub Desktop.
A better random if needed
function Random() {
return crypto.getRandomValues( Random.arr )[ 0 ] / Random.limit;
}
Random.limit = 2 ** 32;
Random.arr = new Uint32Array( 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment