Reputation: 4282
I have over 6 million DB records containing base64 encoded string values.
These are SHA-256 output of random 13 digit numbers.
When I counted with SQL LIKE query, it is over 3 million.
I want to know whether is it normal.
So I tried to calculate the probability of + character occurrence.
Could you confirm this calculation?
(64^44 - 63^44) / 64^44
(Base64 encoding consist of 64 characters)
Upvotes: 0
Views: 718
Reputation: 15035
256 / log2(64) = 42.6666... = 43
+
= 63/64
+
= (63/64)^43
+
= 1 - (63/64)^43 = (64^43 - 63^43) / (64^43)
So your answer was almost correct - just assumed the wrong number of digits. The numerical value is still correct within reasonable error.
Upvotes: 3