Skip to content

Commit ba92115

Browse files
committed
Use 'md5' hashing if 'md4' could not be created
1 parent 1461df8 commit ba92115

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/cache.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,11 @@ const write = async function (filename, compress, result) {
6363
* @return {String}
6464
*/
6565
const filename = function (source, identifier, options) {
66-
// md4 hashing is not supported starting with OpenSSL v3.0.0
67-
const majorOpensslVersion = parseInt(
68-
process.versions.openssl.split(".")[0],
69-
10,
70-
);
7166
let hashType = "md4";
72-
if (majorOpensslVersion >= 3) {
67+
68+
try {
69+
crypto.createHash(hashType);
70+
} catch (err) {
7371
hashType = "md5";
7472
}
7573

0 commit comments

Comments
 (0)