aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/crypto
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-14 19:37:35 +0200
committerFlorian Dold <florian@dold.me>2021-06-14 19:37:35 +0200
commitef636c022bb6f8017ef237a5e6468f5c449665ad (patch)
tree7c7f0fa083a4c02f8d3fb0711b2bd7781cd80879 /packages/taler-wallet-core/src/crypto
parentb4f97f4592cbab6632aff4f1ea4bedccdbf00d3a (diff)
downloadwallet-core-ef636c022bb6f8017ef237a5e6468f5c449665ad.tar.xz
implement force-retrying transactions
Diffstat (limited to 'packages/taler-wallet-core/src/crypto')
-rw-r--r--packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts b/packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts
index 711c83ec6..eab4a2e5c 100644
--- a/packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts
+++ b/packages/taler-wallet-core/src/crypto/primitives/nacl-fast.ts
@@ -5,11 +5,15 @@
// Implementation derived from TweetNaCl version 20140427.
// See for details: http://tweetnacl.cr.yp.to/
-import { createRequire } from "module";
+import * as mod from "module";
-// We need this require function to synchronously
-// import the "crypto" module in the CSPRNG initialization.
-const require = createRequire(import.meta.url);
+let require: any;
+
+if (typeof require !== "function" && mod.default && mod.default.createRequire) {
+ // We need this require function to synchronously
+ // import the "crypto" module in the CSPRNG initialization.
+ require = mod.default.createRequire(import.meta.url);
+}
const gf = function (init: number[] = []): Float64Array {
const r = new Float64Array(16);