note 99205 added to function.md5
| From: | arcade at auditiv dot org | Date: | Tue, 03 Aug 2010 13:57:14 +0000 |
| Subject: | note 99205 added to function.md5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171353@lists.php.net to get a copy of this message | ||
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?
----
Server IP: 69.147.83.197
Probable Submitter: 85.56.16.42
----
Manual Page -- http://www.php.net/manual/en/function.md5.php
Edit -- https://master.php.net/note/edit/99205
Del: integrated -- https://master.php.net/note/delete/99205/integrated
Del: useless -- https://master.php.net/note/delete/99205/useless
Del: bad code -- https://master.php.net/note/delete/99205/bad+code
Del: spam -- https://master.php.net/note/delete/99205/spam
Del: non-english -- https://master.php.net/note/delete/99205/non-english
Del: in docs -- https://master.php.net/note/delete/99205/in+docs
Del: other reasons-- https://master.php.net/note/delete/99205
Reject -- https://master.php.net/note/reject/99205
Search -- https://master.php.net/manage/user-notes.php