(hash: number, words: Uint32Array)
| 71 | } |
| 72 | |
| 73 | function fnv1aUpdate(hash: number, words: Uint32Array): number { |
| 74 | let h = hash >>> 0; |
| 75 | for (let i = 0; i < words.length; i++) { |
| 76 | h ^= words[i]!; |
| 77 | h = Math.imul(h, 0x01000193) >>> 0; // FNV prime |
| 78 | } |
| 79 | return h >>> 0; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Computes a stable 32-bit hash of the Float32 contents using their IEEE-754 |
no outgoing calls
no test coverage detected