From 236d5dc072622d511e2f8f6ddd83fd24a7165467 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 22 Jan 2024 14:40:18 +0100 Subject: [PATCH] `sha256` over `md5` (#202985) * `sha256` over `md5` * add missing JS file --- build/lib/tsb/builder.js | 4 ++-- build/lib/tsb/builder.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/lib/tsb/builder.js b/build/lib/tsb/builder.js index e041a754c4f..e87945ea9cc 100644 --- a/build/lib/tsb/builder.js +++ b/build/lib/tsb/builder.js @@ -89,7 +89,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) { if (/\.d\.ts$/.test(fileName)) { // if it's already a d.ts file just emit it signature const snapshot = host.getScriptSnapshot(fileName); - const signature = crypto.createHash('md5') + const signature = crypto.createHash('sha256') .update(snapshot.getText(0, snapshot.getLength())) .digest('base64'); return resolve({ @@ -106,7 +106,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) { continue; } if (/\.d\.ts$/.test(file.name)) { - signature = crypto.createHash('md5') + signature = crypto.createHash('sha256') .update(file.text) .digest('base64'); if (!userWantsDeclarations) { diff --git a/build/lib/tsb/builder.ts b/build/lib/tsb/builder.ts index 7d40239e715..9fc476ae702 100644 --- a/build/lib/tsb/builder.ts +++ b/build/lib/tsb/builder.ts @@ -113,7 +113,7 @@ export function createTypeScriptBuilder(config: IConfiguration, projectFile: str if (/\.d\.ts$/.test(fileName)) { // if it's already a d.ts file just emit it signature const snapshot = host.getScriptSnapshot(fileName); - const signature = crypto.createHash('md5') + const signature = crypto.createHash('sha256') .update(snapshot.getText(0, snapshot.getLength())) .digest('base64'); @@ -134,7 +134,7 @@ export function createTypeScriptBuilder(config: IConfiguration, projectFile: str } if (/\.d\.ts$/.test(file.name)) { - signature = crypto.createHash('md5') + signature = crypto.createHash('sha256') .update(file.text) .digest('base64');