self.crypto

This commit is contained in:
juanelas 2020-04-08 19:15:19 +02:00
parent 5022ebef3e
commit f4430c5f08
3 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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)