fix: include line number in hashline computation

This commit is contained in:
YeonGyu-Kim
2026-02-21 04:14:54 +09:00
parent df1a0a59d9
commit 5ae9de0e8e
2 changed files with 16 additions and 4 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
import { HASHLINE_DICT } from "./constants"
export function computeLineHash(lineNumber: number, content: string): string {
void lineNumber
const stripped = content.replace(/\s+/g, "")
const hash = Bun.hash.xxHash32(stripped)
const hashInput = `${lineNumber}:${stripped}`
const hash = Bun.hash.xxHash32(hashInput)
const index = hash % 256
return HASHLINE_DICT[index]
}