Link to home
Start Free TrialLog in
Avatar of tomp_gl
tomp_gl

asked on

What is the probability of two different strings having the same MD5 hash?

Hi,

I am planning to create my own query cache. I will be looking up the query results from the cache using an MD5 hash of the query string. There will be tens of thousands of queries stored in the cache. What is the likelihood of two different query strings having the same MD5 hash?

The reason I ask is because to my knowledge MySQL's native query cache looks up cached results using the full query string, instead of using a hash of the query string (which would be faster and use less storage), and I wondered if this was due to potential hash conflicts.

Thanks
SOLUTION
Avatar of racek
racek
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial