What's a good hash function for English words?

后端 未结 4 674
情书的邮戳
情书的邮戳 2020-11-27 19:17

I have a long list of English words and I would like to hash them. What would be a good hashing function? So far my hashing function sums the ASCII values of the letters the

4条回答
  •  温柔的废话
    2020-11-27 20:20

    If you don't need it be cryptographically secure, I would suggest the Murmur Hash. It's extremely fast and has high diffusion. Easy to use.

    http://en.wikipedia.org/wiki/MurmurHash

    http://code.google.com/p/smhasher/wiki/MurmurHash3

    If you do need a cryptographically secure hash, then I suggest SHA1 via OpenSSL.

    http://www.openssl.org/docs/crypto/sha.html

提交回复
热议问题