Fast hash function with collision possibility near SHA-1

前端 未结 7 1882
情书的邮戳
情书的邮戳 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:47

    Check out MurmurHash2_160. It's a modification of MurmurHash2 which produces 160-bit output.

    It computes 5 unique results of MurmurHash2 in parallel and mixes them thoroughly. The collision probability is equivalent to SHA-1 based on the digest size.

    It's still fast, but MurmurHash3_128, SpookyHash128 and MetroHash128 are probably faster, albeit with a higher (but still very unlikely) collision probability. There's also CityHash256 which produces a 256-bit output which should be faster than SHA-1 as well.

提交回复
热议问题