Skip to content

Commit e8a31a0

Browse files
authored
Merge pull request DSpace#5404 from alanorth/use-node-md5
Use node:crypto instead of third-party md5
2 parents 569d0f8 + 0835031 commit e8a31a0

3 files changed

Lines changed: 2 additions & 5 deletions

File tree

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@
210210
"karma-jasmine": "~4.0.0",
211211
"karma-jasmine-html-reporter": "^1.5.0",
212212
"karma-mocha-reporter": "2.2.5",
213-
"md5": "^2.3.0",
214213
"ng-mocks": "^14.15.2",
215214
"ngx-mask": "^16.0.0",
216215
"postcss": "^8.5",

webpack/helpers.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { readFileSync, readdirSync, statSync, Stats } from 'fs';
22
import { join, resolve } from 'path';
3-
4-
const md5 = require('md5');
3+
import { createHash } from 'node:crypto';
54

65
export const projectRoot = (relativePath) => {
76
return resolve(__dirname, '..', relativePath);
@@ -21,7 +20,7 @@ export const globalCSSImports = () => {
2120
*/
2221
export function calculateFileHash(filePath: string): string {
2322
const fileContent: Buffer = readFileSync(filePath);
24-
return md5(fileContent);
23+
return createHash('md5').update(fileContent).digest('hex');
2524
}
2625

2726
/**

0 commit comments

Comments
 (0)