Skip to content

Commit

Permalink
Merge pull request microsoft#29935 from RyanCavanaugh/md5_2_sha
Browse files Browse the repository at this point in the history
Use sha256 to hash file contents
  • Loading branch information
RyanCavanaugh authored Feb 15, 2019
2 parents 691df0e + 7983813 commit d517713
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ namespace ts {
getModifiedTime,
setModifiedTime,
deleteFile,
createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash,
createHash: _crypto ? createSHA256Hash : generateDjb2Hash,
createSHA256Hash: _crypto ? createSHA256Hash : undefined,
getMemoryUsage() {
if (global.gc) {
Expand Down Expand Up @@ -1125,12 +1125,6 @@ namespace ts {
}
}

function createMD5HashUsingNativeCrypto(data: string): string {
const hash = _crypto!.createHash("md5");
hash.update(data);
return hash.digest("hex");
}

function createSHA256Hash(data: string): string {
const hash = _crypto!.createHash("sha256");
hash.update(data);
Expand Down

0 comments on commit d517713

Please sign in to comment.