note 38797 added to function.uniqid

From: Date: Wed, 07 Jan 2004 11:57:26 +0000
Subject: note 38797 added to function.uniqid
Groups: php.notes 
Request: Send a blank email to php-notes+get-63062@lists.php.net to get a copy of this message
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...... ---- Manual Page -- http://www.php.net/manual/en/function.uniqid.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38797 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38797&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38797&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63062) next »