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

Function stringToNumericHash

src/utils/telemetry/perfettoTracing.ts:128–130  ·  view source on GitHub ↗

* Convert a string to a numeric hash for use as thread ID

(str: string)

Source from the content-addressed store, hash-verified

126 * Convert a string to a numeric hash for use as thread ID
127 */
128function stringToNumericHash(str: string): number {
129 return Math.abs(djb2Hash(str)) || 1 // Ensure non-zero
130}
131
132/**
133 * Get or create a numeric process ID for an agent

Callers 2

getCurrentAgentInfoFunction · 0.85
registerAgentFunction · 0.85

Calls 1

djb2HashFunction · 0.85

Tested by

no test coverage detected