Suppose you have an ordered sequence of bitsets b1, b2, b3, ..., bN
.
Is there an efficient bitwise operator hash calculation which can be used to generate hashes which is also associative?
In other words, what is a recommended hashing function hash(bX, bY)
such that:
hash(hash(b1, b2), b3) == hash(b1, hash(b2, b3))
Would bitwise exclusive-or XOR
provide an acceptably low collision rate?
EDIT: Note that there is a related question here.