Revision e2d26bad
Added by koszko almost 2 years ago
common/misc.js | ||
---|---|---|
36 | 36 |
return returnValue; |
37 | 37 |
} |
38 | 38 |
|
39 |
function gen_nonce(length) // Default 16
|
|
39 |
function gen_nonce(length=16)
|
|
40 | 40 |
{ |
41 |
let randomData = new Uint8Array(length || 16);
|
|
41 |
let randomData = new Uint8Array(length); |
|
42 | 42 |
crypto.getRandomValues(randomData); |
43 | 43 |
return Uint8toHex(randomData); |
44 | 44 |
} |
Also available in: Unified diff
Fix sanitizing of non-HTML XMLDocument's