# hash collision chance using a 5 chars hash made of a-z A-Z and 0-9 (62 chars total)

What is the chance for collision or resistance of a hash made out of 5 chars randomly picked from this sets a-z A-Z and 0-9 (62 chars total).

Also, what is total amount of combinations without collision that I can get, AFAIK :

$62^5 = 916.132.832$

Thank you.

There are indeed $$62^5 = 916\,132\,832$$ possible hashes in that syntax. If they are uniformly distributed, then the standard birthday paradox applies to the probability of a collision in $$n$$ independent choices of $$k$$ possible hashes. For $$n < \sqrt{k}/4$$, the probability of collision is between $$(n - 1)^2/(4k)$$ and $$n^2/k$$. For example, among 10 000 hashes, the probability of a collision is at least $$\frac{9\,999^2}{4\cdot916\,132\,832} > 2.7\%,$$ and at most $$\frac{10\,000^2}{916\,132\,832} < 11\%.$$
Of course, if these are hashes from a fixed public hash function like SHAKE128-30 (add two more characters to your alphabet like the base64 + and - to make the numbers work out), it is easy for an adversary to spend the energy to compute a few tens of thousands of hashes offline without interacting with you in order to find a collision with high probability. The lower bound on the collision probability gives a guarantee on the adversary's chance of success after a certain amount of work.