From ba921159211569c040b011336aba3b3bcfeec363 Mon Sep 17 00:00:00 2001 From: pathmapper Date: Sat, 1 Jan 2022 17:47:43 +0100 Subject: [PATCH] Use 'md5' hashing if 'md4' could not be created --- src/cache.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cache.js b/src/cache.js index 6757cbff..9a59e461 100644 --- a/src/cache.js +++ b/src/cache.js @@ -63,13 +63,11 @@ const write = async function (filename, compress, result) { * @return {String} */ const filename = function (source, identifier, options) { - // md4 hashing is not supported starting with OpenSSL v3.0.0 - const majorOpensslVersion = parseInt( - process.versions.openssl.split(".")[0], - 10, - ); let hashType = "md4"; - if (majorOpensslVersion >= 3) { + + try { + crypto.createHash(hashType); + } catch (err) { hashType = "md5"; }