Best hashing algorithm in terms of hash collisions and performance for strings

前端 未结 9 1187
忘掉有多难
忘掉有多难 2020-11-28 03:37

What would be the best hashing algorithm if we had the following priorities (in that order):

  1. Minimal hash collisions
  2. Performance

It doe

9条回答
  •  猫巷女王i
    2020-11-28 03:48

    "Murmurhash" is pretty good on both performance and collisions.

    The mentioned thread at "softwareengineering.stackexchange" has some tests and Murmur wins.

    I wrote my own C# port of MurmurHash 2 to .NET and tested it on a list of 466k English words, got 22 collisions.

    The results and implementation are here: https://github.com/jitbit/MurmurHash.net (disclaimer, I'm involved with this open source project!)

提交回复
热议问题