diff --git a/package.json b/package.json index a988264..3426f8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cf-workers-hash", - "version": "1.0.2", + "version": "1.0.3", "description": "A simple hash function for Cloudflare Workers", "main": "./dist/index.js", "module": "./dist/index.mjs", @@ -59,7 +59,6 @@ "@aws-crypto/crc32": "5.2.0", "@aws-crypto/crc32c": "5.2.0", "bcryptjs": "2.4.3", - "js-md5": "0.8.3", "js-sha3": "0.9.3", "md6-hash": "1.0.0", "whirlpool-hash": "1.1.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c02dc30..f00e3b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,9 +17,6 @@ importers: bcryptjs: specifier: 2.4.3 version: 2.4.3 - js-md5: - specifier: 0.8.3 - version: 0.8.3 js-sha3: specifier: 0.9.3 version: 0.9.3 @@ -3543,10 +3540,6 @@ packages: engines: {node: '>=10'} dev: true - /js-md5@0.8.3: - resolution: {integrity: sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ==} - dev: false - /js-sha3@0.9.3: resolution: {integrity: sha512-BcJPCQeLg6WjEx3FE591wVAevlli8lxsxm9/FzV4HXkV49TmBH38Yvrpce6fjbADGMKFrBMGTqrVz3qPIZ88Gg==} dev: false diff --git a/src/index.ts b/src/index.ts index d32af3a..38b5dbd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,6 @@ /* @typescript-eslint/no-unused-functions */ import * as bcryptjs from 'bcryptjs'; -import * as md5js from 'js-md5'; import * as xxh from 'xxhashjs'; import * as whirlpooljs from 'whirlpool-hash'; import * as sha3 from 'js-sha3'; @@ -19,10 +18,6 @@ function cryptoHasher(hashType: string) { }; } -export function md5(input: string): Promise { - return Promise.resolve(md5js.md5(input)); -} - export function base64(input: string): Promise { return Promise.resolve(btoa(input)); } @@ -35,6 +30,7 @@ export const sha1 = cryptoHasher('SHA-1'); export const sha256 = cryptoHasher('SHA-256'); export const sha384 = cryptoHasher('SHA-384'); export const sha512 = cryptoHasher('SHA-512'); +export const md5 = cryptoHasher('MD5'); export async function bcrypt(input: string, saltRounds: number): Promise { const salt = await bcryptjs.genSalt(saltRounds);