Is there a known hashing algorithm with the following properties?
- Preferably 32 or 64 bits
- Does not need to be a cryptographic hash
- [Added] … but ideally it should uniformly fill out the whole 32/64 bits for any input or length of input
- Can concatenate multiple hashes to get the same hash as the concatenated messages
By that last one, I mean: Let's say that I have a message divided into chunks A, B, C, …. I want to hash each chunk, hash(A), hash(B), etc., and be able to combine the hashes in such a way that hash(A) 🤝 hash(B) 🤝 hash(C) … = hash(A + B + C …).
(It's OK for this to be order-dependent. In fact, it would be preferable for the order of the chunks to change the resulting hash.)
One possible (maybe the only possible) mechanism for this would be that the hash function has no state besides the current value of the hash.
Edit: Changed the operator between the hashes to something wholly fictional to clarify that I'm not proposing concatenating the hash values. Hashes are fixed-length values; it never makes sense to concatenate them.