Merge pull request #29935 from RyanCavanaugh/md5_2_sha

Use sha256 to hash file contents
This commit is contained in:
Ryan Cavanaugh
2019-02-15 10:28:23 -08:00
committed by GitHub
+1 -7
View File
@@ -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) {
@@ -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);