Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-02-07 10:55:13


John Maddock wrote:
>
> If we want a library of string hash functions though, we'd better
> give them different names - there are after all many different ways
> of hashing a string.

There aren't _that_ many good ways to hash a sequence. If you deviate from
*5/*31, hashpjw, and the shift/xor family there is substantial risk that the
new and improved hash function leads to pathological cases where a hash_map
loses to a map with a constant factor of three or more.

For contiguous 8 bit characters there are fast alternatives that process
four characters at a time but they don't generalize to arbitrary sequences.

Cryptographic hash functions are obviously best from a quality standpoint,
but they are too slow for a hash_map.

All IMO, of course. :-)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk