MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / hashString

Function hashString

scripts/fungrim/sample.ts:28–35  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

26/** FNV-1a over a string — derive a per-entry seed so results are independent
27 * of iteration order. */
28export function hashString(s: string): number {
29 let h = 0x811c9dc5;
30 for (let i = 0; i < s.length; i++) {
31 h ^= s.charCodeAt(i);
32 h = Math.imul(h, 0x01000193);
33 }
34 return h >>> 0;
35}
36
37// --- value pools ------------------------------------------------------------
38

Callers 1

numericCheckEntryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected