fix(util): checksum defensiveness

pull/6575/head
Adam 2026-01-01 05:04:26 -06:00
parent d1a4295a32
commit 03733b0505
No known key found for this signature in database
GPG Key ID: 9CB48779AF150E75
1 changed files with 2 additions and 2 deletions

View File

@ -19,8 +19,8 @@ export async function hash(content: string, algorithm = "SHA-256"): Promise<stri
return hashHex
}
export function checksum(content: string): string {
if (!content) return ""
export function checksum(content: string): string | undefined {
if (!content) return undefined
let hash = 0x811c9dc5
for (let i = 0; i < content.length; i++) {
hash ^= content.charCodeAt(i)