Fastest hash for non-cryptographic uses?

后端 未结 13 1126
挽巷
挽巷 2020-12-04 08:23

I\'m essentially preparing phrases to be put into the database, they may be malformed so I want to store a short hash of them instead (I will be simply comparing if they exi

13条回答
  •  醉酒成梦
    2020-12-04 08:29

    If you're looking for fast and unique, I recommend xxHash or something that uses newer cpu's crc32c built-in command, see https://stackoverflow.com/a/11422479/32453. It also links there to possibly even faster hashes if you don't care about the possibility of collision as much.

提交回复
热议问题