# How can I calculate the probability of collisions of a hashing algorithm? [duplicate]

I'm pulling a “Dave” and I'm designing my own hashing algorithm. Not that I intend to use it, I'm not certifiable or anything, I just want the challenge of creating something. I'm not going to get into exactly what I'm doing, because it's probably worthless anyway. I just wanted some advice on how to calculate the chance of collisions.

So, if anybody can enlighten me on how to calculate the probability of collisions happening, I'd greatly appreciate it.

• You mean probability that collisions happen due to weaknesses in your design? Because generally (without cryptanalysis) the probability of finding one is good after $2^{-n/2}$ calls for digest length $n$. Aug 11, 2015 at 17:42
• ... because of the birthday problem. I guess what SEJPM is saying is that the calculation of the probability of collisions that are happening because of the internal design depends on the internal design. $2^{-n/2}$ is just the lower bound (where $n$ is the output size). Aug 11, 2015 at 18:11