A minimal hash function for C?

后端 未结 6 602
攒了一身酷
攒了一身酷 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:00

    You can find a good (and fast) hash function, and an interesting read, at http://www.azillionmonkeys.com/qed/hash.html

    The only time you should not check for collisions, is if you use a perfect hash -- a good old fashioned lookup table, like gperf.

提交回复
热议问题