(s: string)
| 26 | /** FNV-1a over a string — derive a per-entry seed so results are independent |
| 27 | * of iteration order. */ |
| 28 | export 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 |