note 99205 rejected from function.md5 by danbrown
| From: | danbrown@php.net | Date: | Tue, 03 Aug 2010 14:00:13 +0000 |
| Subject: | note 99205 rejected from function.md5 by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171354@lists.php.net to get a copy of this message | ||
Note Submitter: arcade at auditiv dot org
----
Does someone know whether long text encryptions with md5 always gives unique results?
Just asking because we use md5 to generate a unique cache ID for a db cache script. Instead of
creating a proper cache ID for each query we just use the query....
I'm not sure whether md5 works fine that way if there are really long query strings (over 300
characters sometimes) and quite similar with maybe only one character different.
Example:
"SELECT .... FROM ... JOIN ... WHERE ... AND id = 321"
and the same one with just
"SELECT .... FROM ... JOIN ... WHERE ... AND id = 322"
I tested a few times with success but: Will md5() return unique values always?