Created
March 18, 2018 17:25
-
-
Save FrankHassanabad/1a7210292b4c9b7012f8764961386a65 to your computer and use it in GitHub Desktop.
MDN Crypto Example
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
/* assuming that window.crypto.getRandomValues is available */ | |
var array = new Uint32Array(10); | |
window.crypto.getRandomValues(array); | |
console.log("Your lucky numbers:"); | |
for (var i = 0; i < array.length; i++) { | |
console.log(array[i]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From: https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
For: medium article