
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. :-)