mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
fix(util): checksum defensiveness
This commit is contained in:
parent
6341ed506c
commit
d1a4295a32
@ -20,6 +20,7 @@ export async function hash(content: string, algorithm = "SHA-256"): Promise<stri
|
||||
}
|
||||
|
||||
export function checksum(content: string): string {
|
||||
if (!content) return ""
|
||||
let hash = 0x811c9dc5
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
hash ^= content.charCodeAt(i)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user