diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/misc.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/misc.js b/common/misc.js index 91d60d2..6adaf1e 100644 --- a/common/misc.js +++ b/common/misc.js @@ -36,9 +36,9 @@ function Uint8toHex(data) return returnValue; } -function gen_nonce(length) // Default 16 +function gen_nonce(length=16) { - let randomData = new Uint8Array(length || 16); + let randomData = new Uint8Array(length); crypto.getRandomValues(randomData); return Uint8toHex(randomData); } |