A minimal hash function for C?

后端 未结 6 531
攒了一身酷
攒了一身酷 2021-01-29 23:41

I can\'t use boost:hash because I have to stick with C and can\'t use C++.

But, I need to hash a large number (10K to 100k) of tokens strings (5 to 40 bytes length) so t

6条回答
  •  抹茶落季
    2021-01-30 00:01

    1. Here is a nice overview of the most notable known hash functions.

    2. 32bits should work just fine.

    3. You always need to check for collisions, unless you want to write a funny hashtable :)

提交回复
热议问题