Uniquely identifying URLs with one 64-bit number

前端 未结 5 1306
闹比i
闹比i 2021-02-09 05:10

This is basically a math problem, but very programing related: if I have 1 billion strings containing URLs, and I take the first 64 bits of the MD5 hash of each of them, what ki

5条回答
  •  粉色の甜心
    2021-02-09 05:41

    If you have 2^n hash possibilities, there's over a 50% chance of collision when you have 2^(n/2) items.

    E.G. if your hash is 64 bits, you have 2^64 hash possibilities, you'd have a 50% chance of collision if you have 2^32 items in a collection.

提交回复
热议问题