Created
August 5, 2019 23:49
-
-
Save Jagathishrex/ca4c845860b4b8d6d66253b8dc9c4cb8 to your computer and use it in GitHub Desktop.
Getting random numbers using crypto object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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