mirror of
https://github.com/privacyguides/privacyguides.org
synced 2024-11-28 22:13:43 +01:00
added guard clause
This commit is contained in:
parent
78634330de
commit
91fb2972b4
@ -1,5 +1,8 @@
|
||||
var passwordGenerator = (function() {
|
||||
var generateRandomNum = function (max) {
|
||||
if (!window.crypto || !window.crypto.getRandomValues) {
|
||||
throw new Error('Unsupported browser.');
|
||||
}
|
||||
var array = new Uint8Array(1);
|
||||
window.crypto.getRandomValues(array);
|
||||
var range = max + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user