improve(i18n): reduce locale catalog hashing overhead (#152355)

* improve(i18n): reduce locale catalog hashing overhead

* Merge branch 'main' into investigate/p13-sha256-helper-20260919

* Merge branch 'main' into investigate/p13-sha256-helper-20260919

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
Vincent Koc 2026-09-23 22:15:34 +08:00 • committed by GitHub
parent 917029cc35
commit ab5b994413
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,9 +1,9 @@
import { createHash } from "node:crypto";
import { hash } from "node:crypto";
import { existsSync, readFileSync } from "node:fs";
import type { TranslationMap, TranslationMemoryEntry } from "./control-ui-i18n-sync-plan.ts";
export function hashControlUiTranslationText(text: string): string {
return createHash("sha256").update(text.trim().split(/\s+/).join(" ")).digest("hex");
return hash("sha256", text.trim().split(/\s+/).join(" "), "hex");
}
export function mergeControlUiTranslationMaps(