
13 Mar
2005
13 Mar
'05
3:57 p.m.
Dave Harris wrote:
My impression is that the proposed implementation of hash_combine: seed ^= hash_value(v) + (seed << 6) + (seed >> 2);
was designed to combine 8-bit character values; do we have any evidence it also performs well to combine 32-bit values?
(seed << 6) + (seed >> 2) does "neatly" expand an 8 bit value into a 14 bit one, but the seed is not necessarily an 8 bit value. Think of the above as seed ^= hv + seed * 64.25. But no, we don't have hard data on how it performs on 32 bit values.