Created
February 24, 2013 21:23
-
-
Save merickson/5025703 to your computer and use it in GitHub Desktop.
Same JS randomness HTML
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
<html> | |
<head> | |
<title>foo</title> | |
</head> | |
<body> | |
<span id='output'>foo</span> | |
<script type="text/javascript"> | |
/* assuming that window.crypto.getRandomValues is available */ | |
var data = document.getElementById('output'); | |
var array = new Uint32Array(1); | |
window.crypto.getRandomValues(array); | |
console.log(array[0]); | |
data.innerHTML = array[0]; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment