MCPcopy Create free account
hub / github.com/TanStack/db / hashUint8Array

Function hashUint8Array

packages/db-ivm/src/hashing/hash.ts:118–128  ·  view source on GitHub ↗
(input: Uint8Array)

Source from the content-addressed store, hash-verified

116}
117
118function 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
130function hashTemporal(input: TemporalLike): number {
131 const hasher = new MurmurHashStream()

Callers 1

hashObjectFunction · 0.85

Calls 3

updateMethod · 0.95
writeByteMethod · 0.95
digestMethod · 0.95

Tested by

no test coverage detected