Reference: https://twitter.com/ramsey/status/926473482409476096
This was a really crazy bug @bdeshong & @jpcorry found. Randomly, the system generated an MD5 hash that looked like scientific notation.
MD5 hashes are 32 characters in hexadecimal (base-16, 0-9 A-F). Scientific notation is recognized in PHP as one or more decimal digits, followed by E, followed by one or more decimal digits.
"1E234" is numeric
"E1234" is not numeric
"1234E" is not numeric
What would be the probability of randomly generating an MD5 hash of this kind?
You're looking for the probability that a string of 32 characters in $\{0, 1, \ldots, 9, A, B, \ldots F \}$, chosen uniformly at random, has all its characters are numeric (0 to 9), except for one character which is $E$, which is not the first or last character.
There are of course $16^{32}$ total possible hashes.
To construct a hash which looks like a number in scientific notation, first pick where the $E$ goes. There are $32 - 2 = 30$ ways to do this. Then fill in the remaining 31 characters with digits, which can be done in $10^{31}$ ways.
So the probability you're looking for is
$$ {30 \times 10^{31} \over 16^{32}} \approx 8.8 \times 10^{-7}. $$