mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Use sha256 to hash file contents
This commit is contained in:
parent
33af4ea250
commit
7983813be0
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user