mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-05 07:52:03 +00:00
fix(util): checksum defensiveness
This commit is contained in:
parent
6341ed506c
commit
d1a4295a32
1 changed files with 1 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue