From ef084d43ba29ebf3c3c0ea0939a5c58adad0bba2 Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Thu, 4 Nov 2021 18:21:57 +0300 Subject: [PATCH] fix: crash with md4 hash (#198) --- 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());