From ef636c022bb6f8017ef237a5e6468f5c449665ad Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Jun 2021 19:37:35 +0200 Subject: implement force-retrying transactions --- .../taler-wallet-core/src/crypto/primitives/nacl-fast.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-core/src/crypto') 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); -- cgit v1.2.3