fixed email in package.json. self.crypto

This commit is contained in:
juanelas 2020-04-08 19:15:03 +02:00
parent 827e853c5e
commit 5022ebef3e
5 changed files with 6 additions and 7 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

@ -448,7 +448,7 @@ function randBytesSync (byteLength, forceLength = false) {
/* eslint-disable no-lone-blocks */
{ // browser
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 }
return buf

View File

@ -15,7 +15,7 @@
"license": "MIT",
"author": {
"name": "Juan Hernández Serrano",
"email": "jserrano@entel.upc.edu",
"email": "j.hernandez@upc.edu",
"url": "https://github.com/juanelas"
},
"repository": "github:juanelas/bigint-crypto-utils",
@ -47,7 +47,6 @@
"BigInt",
"Blob",
"postMessage",
"crypto",
"self",
"Worker"
],

View File

@ -258,7 +258,7 @@ export function randBytes (byteLength, forceLength = false) {
} else { // 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)
@ -288,7 +288,7 @@ export function randBytesSync (byteLength, forceLength = false) {
return buf
} else { // browser
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 }
return buf