Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.

Commit e85a810

Browse files
Remove "md4" from crypto.ts
1 parent aa99635 commit e85a810

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/extends/src/crypto.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import crypto from "node:crypto";
22
import stream from "node:stream";
33

4-
export type hashAlgorithm = "sha1" | "sha256" | "sha512" | "md4" | "md5";
5-
const ALGORITHM_MAP: (hashAlgorithm|"all")[] = ["all", "sha1", "sha256", "sha512", "md4", "md5"];
4+
export type hashAlgorithm = "sha1" | "sha256" | "sha512" | "md5";
5+
const ALGORITHM_MAP: (hashAlgorithm|"all")[] = ["all", "sha1", "sha256", "sha512", "md5"];
66

77
export type hashObject = {
88
byteLength: number,
@@ -52,9 +52,6 @@ export function createHash(target?: "all"|hashAlgorithm, digestText?: crypto.Bin
5252
// sha1
5353
if ((["all", "sha1"]).includes(target)) crypHash.sha1 = crypto.createHash("sha1");
5454

55-
// md4
56-
if ((["all", "md4"]).includes(target)) crypHash.md4 = crypto.createHash("md4");
57-
5855
// md5
5956
if ((["all", "md5"]).includes(target)) crypHash.md5 = crypto.createHash("md5");
6057

@@ -95,4 +92,4 @@ export async function createHashAsync(from: stream.Readable|stream.Transform|str
9592
if (from instanceof Buffer || typeof from === "string") from = stream.Readable.from(from);
9693
return from.pipe(createHash(...args)).on("hashObject", resolve).on("error", reject);
9794
});
98-
}
95+
}

0 commit comments

Comments
 (0)