Skip to content

Commit 7515d68

Browse files
committed
fix: more secure hash
1 parent 31a4ba3 commit 7515d68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { redLog, yellowLog } from './consoleColor';
1010
const findSimilarFiles = (files: Map<string, Buffer>): string[][] => {
1111
const contentComparer: Map<string, string[]> = new Map();
1212
for (const [filename, content] of files.entries()) {
13-
const hash = createHash('md5').update(content.toString()).digest('hex');
13+
const hash = createHash('sha256').update(content).digest('hex');
1414
if (contentComparer.has(hash)) contentComparer.get(hash)!.push(filename);
1515
else contentComparer.set(hash, [filename]);
1616
}

0 commit comments

Comments
 (0)