What is the best 32bit hash function for short strings (tag names)?

前端 未结 8 1446
傲寒
傲寒 2020-12-12 16:43

What is the best 32bit hash function for relatively short strings?

Strings are tag names that consist of English letters, numbers, spaces and some additional charact

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-12 16:45

    I'm sorry for the very late reply on this. Earlier this year I composed a page titled Hashing Short Strings which might be helpful in this discussion. In summary, I found that CRC-32 and FNV-1a are superior for hashing short strings. They are efficient and produced widely distributed and collision free hashes in my tests. I was surprised to find that MD5, SHA-1 and SHA-3 produced small numbers of collisions when the output was folded down to 32-bits.

提交回复
热议问题