note 44037 added to function.uniqid
| From: | MahdiBENHAMIDA at rn2 dot php dot net | Date: | Tue, 13 Jul 2004 11:41:17 +0000 |
| Subject: | note 44037 added to function.uniqid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73145@lists.php.net to get a copy of this message | ||
We can also add a "salt" to make md5 string harder to guess.
<?php
$salt = "secret123";
$token = md5 (uniqid (""));
$better_token = md5 (uniqid (rand()));
$better_better_token = md5(md5(uniqid(rand()) . $salt));
?>
crypt() do the same way on linux machines in order to make a brute-force attack hard.
----
Manual Page -- http://www.php.net/manual/en/function.uniqid.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44037
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44037&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44037&report=yes
Search -- http://master.php.net/manage/user-notes.php