From 96dc5ec3fa5702841b3a73718fc6823905c6a93c Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Thu, 4 Nov 2021 18:08:32 +0300 Subject: [PATCH] fix: crash with md4 hash --- lib/getHashDigest.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/getHashDigest.js b/lib/getHashDigest.js index 505d6a3..6259503 100644 --- a/lib/getHashDigest.js +++ b/lib/getHashDigest.js @@ -67,6 +67,10 @@ function getHashDigest(buffer, algorithm, digestType, maxLength) { } else if (algorithm === "md4") { if (createMd4 === undefined) { createMd4 = require("./hash/md4"); + + if (BatchedHash === undefined) { + BatchedHash = require("./hash/BatchedHash"); + } } hash = new BatchedHash(createMd4());