mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Use sha256 to hash file contents
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user