MCPcopy
hub / github.com/claude-code-best/claude-code / djb2Hash

Function djb2Hash

src/utils/hash.ts:7–13  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

5 * output (e.g. cache directory names that must survive runtime upgrades).
6 */
7export function djb2Hash(str: string): number {
8 let hash = 0
9 for (let i = 0; i < str.length; i++) {
10 hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0
11 }
12 return hash
13}
14
15/**
16 * Hash arbitrary content for change detection. Bun.hash is ~100x faster than

Callers 5

hash.test.tsFile · 0.90
sanitizePathFunction · 0.85
simpleHashFunction · 0.85
stringToNumericHashFunction · 0.85
computeHashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected