Skip to content

Commit d3ef8b0

Browse files
authored
Merge pull request #5413 from alanorth/use-node-md5-8x
[Port dspace-8_x] Use node:crypto instead of third-party md5
2 parents 947bf16 + 3aac853 commit d3ef8b0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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)