Skip to content

Commit 1e29a6c

Browse files
authored
Merge pull request #178 from ChainSafe/jeluard/use-noble-hashes
Simplify crypto usage
2 parents 3b4db7d + e36077f commit 1e29a6c

File tree

4 files changed

+12
-311
lines changed

4 files changed

+12
-311
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@
8787
"@chainsafe/eslint-plugin-node": "^11.2.3",
8888
"@chainsafe/threads": "^1.9.0",
8989
"@lodestar/spec-test-util": "1.13.0",
90+
"@noble/hashes": "^1.4.0",
9091
"@types/chai": "^4.2.9",
9192
"@types/mocha": "^10.0.0",
9293
"@types/node": "^20.11.13",
9394
"@typescript-eslint/eslint-plugin": "^4.31.1",
9495
"@typescript-eslint/parser": "^4.31.1",
9596
"buffer": "^6.0.3",
9697
"chai": "^4.3.6",
97-
"crypto-browserify": "^3.12.0",
9898
"eslint": "^7.14.0",
9999
"eslint-plugin-import": "^2.20.1",
100100
"eslint-plugin-prettier": "^3.1.4",

test/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import crypto from "crypto";
1+
import {randomBytes} from "@noble/hashes/utils";
22

33
export function randomMessage(): Uint8Array {
4-
return crypto.randomBytes(32);
4+
return randomBytes(32);
55
}
66

77
export function getN<T>(n: number, getter: () => T): T[] {

webpack.config.cjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ module.exports = {
2121
plugins: [
2222
new ResolveTypeScriptPlugin(),
2323
],
24-
alias: {
25-
"crypto": "crypto-browserify",
26-
},
2724
fallback: {
2825
fs: false,
2926
path: false,
3027
stream: false,
28+
crypto: false,
3129
child_process: false,
3230
},
3331
},

0 commit comments

Comments
 (0)