self.crypto
This commit is contained in:
parent
5022ebef3e
commit
f4430c5f08
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -425,7 +425,7 @@ function randBytes (byteLength, forceLength = false) {
|
|||
{ // browser
|
||||
return new Promise(function (resolve) {
|
||||
const buf = new Uint8Array(byteLength)
|
||||
crypto.getRandomValues(buf)
|
||||
self.crypto.getRandomValues(buf)
|
||||
// If fixed length is required we put the first bit to 1 -> to get the necessary bitLength
|
||||
if (forceLength) buf[0] = buf[0] | 128
|
||||
resolve(buf)
|
||||
|
|
Loading…
Reference in New Issue