An SHA-$ 256 $ hash is one that is $ 64 $ digits long, where every digit is a hex value ($ 0 $-$ 9 $ and a-f). Here’s an example hash:
Now, I would like to calculate the probability of a hash containing a (random) substring with $ n $ digits (the substring is also made up of hex values).
For example, what would be the probability of the hash containing a random 2-digit substring (e.g.‘c$8$’)?
Or what would be the probability of the hash containing a random $ 3 $-digit substring (e.g. ‘c$84$’)?
I did some numerical tests using OpenOffice, giving a 1.5% probability for a 3-digit string. But I don’t know how to exactly calculate the probabilities.
Thanks for your suggestions and hints!