Uniquely identifying URLs with one 64-bit number

前端 未结 5 1318
闹比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条回答
  •  Happy的楠姐
    2021-02-09 05:36

    You have tagged this as "birthday-paradox", I think you know the answer already.

    P(Collision) = 1 - (2^64)!/((2^64)^n (1 - n)!)
    

    where n is 1 billion in your case.

    You will be a bit better using something other then MD5, because MD5 have pratical collusion problem.

提交回复
热议问题