mirror of
https://github.com/privacyguides/privacyguides.org.git
synced 2024-12-20 05:14:35 -05:00
added support for IE 11
This commit is contained in:
parent
91fb2972b4
commit
1968f71abb
@ -1,10 +1,11 @@
|
||||
var passwordGenerator = (function() {
|
||||
var generateRandomNum = function (max) {
|
||||
if (!window.crypto || !window.crypto.getRandomValues) {
|
||||
var crypto = window.crypto || window.msCrypto;
|
||||
if (!crypto) {
|
||||
throw new Error('Unsupported browser.');
|
||||
}
|
||||
var array = new Uint8Array(1);
|
||||
window.crypto.getRandomValues(array);
|
||||
crypto.getRandomValues(array);
|
||||
var range = max + 1;
|
||||
var max_range = 256;
|
||||
if (array[0] >= Math.floor(max_range / range) * range)
|
||||
|
Loading…
Reference in New Issue
Block a user