Skip to content

Instantly share code, notes, and snippets.

@Jagathishrex
Created August 5, 2019 23:49
Show Gist options
  • Save Jagathishrex/ca4c845860b4b8d6d66253b8dc9c4cb8 to your computer and use it in GitHub Desktop.
Save Jagathishrex/ca4c845860b4b8d6d66253b8dc9c4cb8 to your computer and use it in GitHub Desktop.
Getting random numbers using crypto object
function random() {
var crypto = window.crypto;
var typedArray = new Uint8Array(10); // 10 elements
crypto.getRandomValues(typedArray);
console.log(typedArray);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment