(input: Uint8Array)
| 116 | } |
| 117 | |
| 118 | function hashUint8Array(input: Uint8Array): number { |
| 119 | const hasher = new MurmurHashStream() |
| 120 | hasher.update(UINT8ARRAY_MARKER) |
| 121 | // Hash the byte length first to differentiate arrays of different sizes |
| 122 | hasher.update(input.byteLength) |
| 123 | // Hash each byte in the array |
| 124 | for (let i = 0; i < input.byteLength; i++) { |
| 125 | hasher.writeByte(input[i]!) |
| 126 | } |
| 127 | return hasher.digest() |
| 128 | } |
| 129 | |
| 130 | function hashTemporal(input: TemporalLike): number { |
| 131 | const hasher = new MurmurHashStream() |
no test coverage detected