note 44037 deleted from function.uniqid by tomsommer
| From: | tomsommer@php.net | Date: | Tue, 13 Jul 2004 18:18:02 +0000 |
| Subject: | note 44037 deleted from function.uniqid by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-73176@lists.php.net to get a copy of this message | ||
Note Submitter: Mahdi BEN HAMIDA
----
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.