Fast hash function with collision possibility near SHA-1

前端 未结 7 1777
情书的邮戳
情书的邮戳 2021-02-20 06:52

I\'m using SHA-1 to detect duplicates in a program handling files. It is not required to be cryptographic strong and may be reversible. I found this list of fast hash functions

7条回答
  •  鱼传尺愫
    2021-02-20 07:43

    Google developed and uses (I think) FarmHash for performance-critical hashing. From the project page:

    FarmHash is a successor to CityHash, and includes many of the same tricks and techniques, several of them taken from Austin Appleby’s MurmurHash.

    ...

    On CPUs with all the necessary machine instructions, about six different hash functions can contribute to FarmHash's lineup. In some cases we've made significant performance gains over CityHash by using newer instructions that are now commonly available. However, we've also squeezed out some more speed in other ways, so the vast majority of programs using CityHash should gain at least a bit when switching to FarmHash.

    (CityHash was already a performance-optimized hash function family by Google.)

    It was released a year ago, at which point it was almost certainly the state of the art, at least among the published algorithms. (Or else Google would have used something better.) There's a good chance it's still the best option.

提交回复
热议问题