note 38797 deleted from function.uniqid by aidan

From: Date: Sun, 07 Nov 2004 11:51:41 +0000
Subject: note 38797 deleted from function.uniqid by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-80222@lists.php.net to get a copy of this message
Note Submitter: Tijmen ---- md5 seems to be fine for generating random strings but .... it is not said that these strings will be UNIQUE. I found this out on a database of us with 50.000+ users where we generated a md5 sum using username and their userid. After creating all the md5 sums for the users we added a UNIQUE key on the field containing the md5 sums. It turned out that there were severall users who had the same md5 sum although their password and userid were completely different. When using this md5 value stored in a cookie to relogin the users the first id that was found according to the md5 sum in the cookie was assigned. This was however not always the userid of the user trying to login......

« previous php.notes (#80222) next »