Skip to content

Commit

Permalink
Merge pull request #638 from lencioni/7.x-md4
Browse files Browse the repository at this point in the history
Use md4 instead of sha1 for filename hashes
  • Loading branch information
xtuc committed Jul 5, 2018
2 parents 8fe5da3 + 19fb463 commit fa91723
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fs-cache.js
Expand Up @@ -71,16 +71,16 @@ const write = function(filename, result, callback) {
* @return {String}
*/
const filename = function(source, identifier, options) {
const hash = crypto.createHash("SHA1");
const hash = crypto.createHash("md4");
const contents = JSON.stringify({
source: source,
options: options,
identifier: identifier,
});

hash.end(contents);
hash.update(contents);

return hash.read().toString("hex") + ".json.gz";
return hash.digest("hex") + ".json.gz";
};

/**
Expand Down

0 comments on commit fa91723

Please sign in to comment.