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 */
|
/* eslint-disable no-lone-blocks */
|
||||||
{ // browser
|
{ // browser
|
||||||
const buf = new Uint8Array(byteLength)
|
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 fixed length is required we put the first bit to 1 -> to get the necessary bitLength
|
||||||
if (forceLength) { buf[0] = buf[0] | 128 }
|
if (forceLength) { buf[0] = buf[0] | 128 }
|
||||||
return buf
|
return buf
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Juan Hernández Serrano",
|
"name": "Juan Hernández Serrano",
|
||||||
"email": "jserrano@entel.upc.edu",
|
"email": "j.hernandez@upc.edu",
|
||||||
"url": "https://github.com/juanelas"
|
"url": "https://github.com/juanelas"
|
||||||
},
|
},
|
||||||
"repository": "github:juanelas/bigint-crypto-utils",
|
"repository": "github:juanelas/bigint-crypto-utils",
|
||||||
|
@ -47,7 +47,6 @@
|
||||||
"BigInt",
|
"BigInt",
|
||||||
"Blob",
|
"Blob",
|
||||||
"postMessage",
|
"postMessage",
|
||||||
"crypto",
|
|
||||||
"self",
|
"self",
|
||||||
"Worker"
|
"Worker"
|
||||||
],
|
],
|
||||||
|
|
|
@ -258,7 +258,7 @@ export function randBytes (byteLength, forceLength = false) {
|
||||||
} else { // browser
|
} else { // browser
|
||||||
return new Promise(function (resolve) {
|
return new Promise(function (resolve) {
|
||||||
const buf = new Uint8Array(byteLength)
|
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 fixed length is required we put the first bit to 1 -> to get the necessary bitLength
|
||||||
if (forceLength) buf[0] = buf[0] | 128
|
if (forceLength) buf[0] = buf[0] | 128
|
||||||
resolve(buf)
|
resolve(buf)
|
||||||
|
@ -288,7 +288,7 @@ export function randBytesSync (byteLength, forceLength = false) {
|
||||||
return buf
|
return buf
|
||||||
} else { // browser
|
} else { // browser
|
||||||
const buf = new Uint8Array(byteLength)
|
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 fixed length is required we put the first bit to 1 -> to get the necessary bitLength
|
||||||
if (forceLength) { buf[0] = buf[0] | 128 }
|
if (forceLength) { buf[0] = buf[0] | 128 }
|
||||||
return buf
|
return buf
|
||||||
|
|
Loading…
Reference in New Issue