MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / hashString

Function hashString

common/src/util/analytics-sampling.ts:120–127  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

118}
119
120function hashString(input: string): number {
121 let hash = 2166136261
122 for (let i = 0; i < input.length; i++) {
123 hash ^= input.charCodeAt(i)
124 hash = Math.imul(hash, 16777619)
125 }
126 return hash >>> 0
127}
128
129function getSamplingKey(params: {
130 event: AnalyticsEvent

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected