We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d3e586 commit 450694eCopy full SHA for 450694e
packages/sha2/src.ts/sha2.ts
@@ -2,6 +2,8 @@
2
3
import { createHash, createHmac } from "crypto";
4
5
+import hash from "hash.js";
6
+
7
import { arrayify, BytesLike } from "@ethersproject/bytes";
8
9
import { SupportedAlgorithm } from "./types";
@@ -11,7 +13,7 @@ import { version } from "./_version";
11
13
const logger = new Logger(version);
12
14
15
export function ripemd160(data: BytesLike): string {
- return "0x" + createHash("ripemd160").update(Buffer.from(arrayify(data))).digest("hex")
16
+ return "0x" + (hash.ripemd160().update(arrayify(data)).digest("hex"));
17
}
18
19
export function sha256(data: BytesLike): string {
0 commit comments