diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..bfeccd1048052e274d9e649b99215dfed259f10a
--- /dev/null
+++ b/.DS_Store
@@ -0,0 +1 @@
+Bud1�1Scompliblg1Scompz�libmoDDblob`�R�j�AlibmodDblob`�R�j�Alibph1Scomp� @� @� @� @E�DSDB ` @� @� @
\ No newline at end of file
diff --git a/lib/.DS_Store b/lib/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..9798d0dd4cfe5a7e0c1f1e563a8e1214977baf94
--- /dev/null
+++ b/lib/.DS_Store
@@ -0,0 +1 @@
+Bud1�1Scompesmlg1Scomp��esmmoDDblob_i�Xj�AesmmodDblob_i�Xj�Aesmph1Scomp� @� @� @� @E�DSDB ` @� @� @
\ No newline at end of file
diff --git a/lib/esm/index.js b/lib/esm/index.js
index 55baa4f5619bc0ae7c830d95369193d7c94e3af0..21e8991119e6ab28a11504b9dba7adf5308e4144 100644
--- a/lib/esm/index.js
+++ b/lib/esm/index.js
@@ -1103,7 +1103,7 @@ export const schnorr = {
 };
 Point.BASE._setWindowSize(8);
 const crypto = {
-    node: nodeCrypto,
+    node: typeof require === 'function' && require('crypto'),
     web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined,
 };
 const TAGS = {
@@ -1143,8 +1143,7 @@ export const utils = {
             return crypto.web.getRandomValues(new Uint8Array(bytesLength));
         }
         else if (crypto.node) {
-            const { randomBytes } = crypto.node;
-            return Uint8Array.from(randomBytes(bytesLength));
+            return crypto.node.randomBytes(bytesLength);
         }
         else {
             throw new Error("The environment doesn't have randomBytes function");
