-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tuditi <[email protected]>
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
diff --git a/node_modules/@noble/hashes/esm/utils.js b/node_modules/@noble/hashes/esm/utils.js | ||
index 65546d2..88e9246 100644 | ||
--- a/node_modules/@noble/hashes/esm/utils.js | ||
+++ b/node_modules/@noble/hashes/esm/utils.js | ||
@@ -5,7 +5,7 @@ | ||
// from `crypto` to `cryptoNode`, which imports native module. | ||
// Makes the utils un-importable in browsers without a bundler. | ||
// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. | ||
-import { crypto } from '@noble/hashes/crypto'; | ||
+// import { crypto } from '@noble/hashes/crypto'; | ||
// Cast array to different type | ||
export const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); | ||
export const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); | ||
diff --git a/node_modules/@noble/hashes/src/utils.ts b/node_modules/@noble/hashes/src/utils.ts | ||
index 28d4df7..78b5dc7 100644 | ||
--- a/node_modules/@noble/hashes/src/utils.ts | ||
+++ b/node_modules/@noble/hashes/src/utils.ts | ||
@@ -6,7 +6,7 @@ | ||
// from `crypto` to `cryptoNode`, which imports native module. | ||
// Makes the utils un-importable in browsers without a bundler. | ||
// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. | ||
-import { crypto } from '@noble/hashes/crypto'; | ||
+// import { crypto } from '@noble/hashes/crypto'; | ||
|
||
// prettier-ignore | ||
export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | | ||
diff --git a/node_modules/@noble/hashes/utils.js b/node_modules/@noble/hashes/utils.js | ||
index c907436..52c92de 100644 | ||
--- a/node_modules/@noble/hashes/utils.js | ||
+++ b/node_modules/@noble/hashes/utils.js | ||
@@ -8,7 +8,7 @@ exports.randomBytes = exports.wrapXOFConstructorWithOpts = exports.wrapConstruct | ||
// from `crypto` to `cryptoNode`, which imports native module. | ||
// Makes the utils un-importable in browsers without a bundler. | ||
// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. | ||
-const crypto_1 = require("@noble/hashes/crypto"); | ||
+// const crypto_1 = require("@noble/hashes/crypto"); | ||
// Cast array to different type | ||
const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); | ||
exports.u8 = u8; | ||
@@ -189,8 +189,8 @@ exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts; | ||
* Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS. | ||
*/ | ||
function randomBytes(bytesLength = 32) { | ||
- if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') { | ||
- return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); | ||
+ if (crypto.crypto && typeof crypto.crypto.getRandomValues === 'function') { | ||
+ return crypto.crypto.getRandomValues(new Uint8Array(bytesLength)); | ||
} | ||
throw new Error('crypto.getRandomValues must be defined'); | ||
} |