diff --git a/bin/tweetnacl-esm.ts b/bin/tweetnacl-esm.ts index 77a4a9a..6c025fc 100644 --- a/bin/tweetnacl-esm.ts +++ b/bin/tweetnacl-esm.ts @@ -34,22 +34,7 @@ async function copyFromModulesDir( await copyFromModulesDir( "nacl.js", - ` -// added by nkeys.js -// shim for crypto.randomBytes on nodejs when using the -// esm module of the nkeys.js library -if (!globalThis.crypto) { - if (typeof module === "undefined") { - globalThis.crypto = { - randomBytes: (a) => { - for (let i = 0; i < a.length; i++) { - a[i] = Math.floor(256 * Math.random()); - } - }, - }; - } -} -`, + "", ` //added by nkeys.js export it export const nacl = globalThis.nacl; diff --git a/modules/esm/nacl.js b/modules/esm/nacl.js index 2379605..279b0a9 100644 --- a/modules/esm/nacl.js +++ b/modules/esm/nacl.js @@ -3,21 +3,6 @@ // deno-lint-ignore-file // deno-fmt-ignore-file - -// added by nkeys.js -// shim for crypto.randomBytes on nodejs when using the -// esm module of the nkeys.js library -if (!globalThis.crypto) { - if (typeof module === "undefined") { - globalThis.crypto = { - randomBytes: (a) => { - for (let i = 0; i < a.length; i++) { - a[i] = Math.floor(256 * Math.random()); - } - }, - }; - } -} (function(nacl) { 'use strict';