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
/** | |
* License: WTFPL, CC0, ZAP (Zero For 0wned Anti-copyright Pledge), etc | |
*/ | |
function secure_rand(min, max) { | |
var i = rval = bits = bytes = 0; | |
var range = max - min; | |
if (range < 1) { | |
return min; | |
} | |
if (window.crypto && window.crypto.getRandomValues) { |