From 81ae93870b5dba0f7d75d4576716f70dfffb426f Mon Sep 17 00:00:00 2001 From: Tomasz Szuba Date: Wed, 24 Jan 2024 08:54:07 +0000 Subject: [PATCH 1/2] Use sha1, instead of md5 This allows prebuild-install to be used on fips systems --- util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.js b/util.js index 4d00351..845c63c 100644 --- a/util.js +++ b/util.js @@ -74,7 +74,7 @@ function trimSlashes (str) { } function cachedPrebuild (url) { - const digest = crypto.createHash('md5').update(url).digest('hex').slice(0, 6) + const digest = crypto.createHash('sha1').update(url).digest('hex').slice(0, 6) return path.join(prebuildCache(), digest + '-' + path.basename(url).replace(/[^a-zA-Z0-9.]+/g, '-')) } From b8311a866ab5d0946fa4e495db5108a98c1576b2 Mon Sep 17 00:00:00 2001 From: Tomasz Szuba Date: Mon, 19 Feb 2024 12:05:33 +0100 Subject: [PATCH 2/2] Update util.js --- util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.js b/util.js index 845c63c..d7cc515 100644 --- a/util.js +++ b/util.js @@ -74,7 +74,7 @@ function trimSlashes (str) { } function cachedPrebuild (url) { - const digest = crypto.createHash('sha1').update(url).digest('hex').slice(0, 6) + const digest = crypto.createHash('sha512').update(url).digest('hex').slice(0, 6) return path.join(prebuildCache(), digest + '-' + path.basename(url).replace(/[^a-zA-Z0-9.]+/g, '-')) }