Skip to content

Commit 2be8191

Browse files
evilebottnawimichael-ciniawsky
authored andcommitted
perf(index): switch to md4 for content hashing (#239)
1 parent c097601 commit 2be8191

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/writeFile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import serialize from 'serialize-javascript';
55
import { name, version } from '../package.json';
66
import findCacheDir from 'find-cache-dir';
77
import { stat, readFile } from './utils/promisify';
8+
import crypto from 'crypto';
89

910
export default function writeFile(globalRef, pattern, file) {
1011
const {info, debug, compilation, fileDependencies, written, inputFileSystem, copyUnmodified} = globalRef;
@@ -40,7 +41,7 @@ export default function writeFile(globalRef, pattern, file) {
4041
name,
4142
version,
4243
pattern,
43-
content
44+
hash: crypto.createHash('md4').update(content).digest('hex')
4445
});
4546

4647
return cacache

0 commit comments

Comments
 (0)