Suppose I have an ordered list of n objects (x1, x2, ..., xn) of some type (for example, binary data files of variable length).
Each of these objects was protected by hashing (e.g. SHA1) to create an x-bit hash code (h1, h2, ..., hn)
Now I want to combine these hash codes into a composite code that uniquely and reliably (ignoring the likelihood of an accidental collision) identifies an ordered list.
(Assume the objects are large and reading their actual data is again not an option)
One naive and wrong way to do this would be XOR hash codes together. This has the undesirable property that (x1, x2) will have the same composite code as (x2, x1).
By what algorithm can I combine hash codes with the desired properties?
source
share