There is a hash table implementation on AVL trees with a whole key, where the key length (in the table, and not in the tree) is no more than 256 bytes. CRC32 was used to calculate the key in the tree. This was enough to work with several tens of thousands of elements (up to 10). But there is an opinion that if we are talking only about hundreds of elements, then you can pick up something more brightly CRC32. So far the only thing that with such a length surely overtakes the CRC32 in speed - ROT13 ... But not at times, by interest. Or is there no point in messing around?
1 answer
It has one of the most extensive comparisons of various hash functions in terms of performance. Columns correspond to different sets of hashed data, rows to functions. Large numbers show the elapsed time (less - faster), next to small numbers in square brackets - the number of collisions (less - better hash).
As can be seen from this - most of the widespread hash functions do not differ so much in speed and performance.
- With one link you killed a million thoughts on the topic "how hashes are arranged inside" :-) - gottar
|