Set webcrypto only if crypto instance is not available (#1338)
* set webcrypto only if not available * update package-lock.json * add changelog
This commit is contained in:
parent
89cc999a57
commit
f02e15dea1
3 changed files with 6 additions and 3 deletions
1
changelogs/unreleased/1338-dark64
Normal file
1
changelogs/unreleased/1338-dark64
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Set webcrypto only if crypto instance is not available (nodejs)
|
|
@ -1,5 +1,7 @@
|
||||||
// https://docs.rs/getrandom/0.2.8/getrandom/index.html#nodejs-es-module-support
|
// https://docs.rs/getrandom/0.2.8/getrandom/index.html#nodejs-es-module-support
|
||||||
import { webcrypto } from "node:crypto";
|
import { webcrypto } from "node:crypto";
|
||||||
globalThis.crypto = webcrypto;
|
if (typeof globalThis.crypto === "undefined") {
|
||||||
|
globalThis.crypto = webcrypto;
|
||||||
|
}
|
||||||
|
|
||||||
export * from "./index.js";
|
export * from "./index.js";
|
||||||
|
|
4
zokrates_js/package-lock.json
generated
4
zokrates_js/package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "zokrates-js",
|
"name": "zokrates-js",
|
||||||
"version": "1.1.5",
|
"version": "1.1.8",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "zokrates-js",
|
"name": "zokrates-js",
|
||||||
"version": "1.1.5",
|
"version": "1.1.8",
|
||||||
"license": "GPLv3",
|
"license": "GPLv3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pako": "^2.1.0"
|
"pako": "^2.1.0"
|
||||||
|
|
Loading…
Reference in a new issue