fixed email in package.json. self.crypto
This commit is contained in:
parent
827e853c5e
commit
5022ebef3e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
],
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue