Skip to content

Commit

Permalink
Use 'md5' hashing if 'md4' could not be created
Browse files Browse the repository at this point in the history
  • Loading branch information
pathmapper committed Jan 1, 2022
1 parent 1461df8 commit ba92115
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down

0 comments on commit ba92115

Please sign in to comment.