MCPcopy Create free account
hub / github.com/idosal/git-mcp / simpleHash

Function simpleHash

src/api/utils/vectorStore.ts:211–218  ·  view source on GitHub ↗

* Simple string hash function

(str: string)

Source from the content-addressed store, hash-verified

209 * Simple string hash function
210 */
211function simpleHash(str: string): number {
212 let hash = 0;
213 for (let i = 0; i < str.length; i++) {
214 hash = (hash << 5) - hash + str.charCodeAt(i);
215 hash = hash & hash; // Convert to 32bit integer
216 }
217 return Math.abs(hash);
218}
219
220/**
221 * Common English words to filter out

Callers 1

getEmbeddingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected