note 21907 deleted from function.md5 by jimw
| From: | jimw@php.net | Date: | Sat, 08 Feb 2003 19:49:02 +0000 |
| Subject: | note 21907 deleted from function.md5 by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43636@lists.php.net to get a copy of this message | ||
Response to anonymous post on 29-May-2002 05:51
The original source I was commenting on was from dgolesny@avo-web.de, not dpiper@stens.com. But,
moving on...
Yes, your code is roughly what I was talking about. However, there are 95 printable characters, so
why constrain yourself to only 65? Turn
$rndchr=mt_rand(0,64);
into
$rndchr=mt_rand(0,95);
and then add 32 to the result and print the character directly. Granted this makes for ugly-looking
passwords that are hard to type, but that also makes them much more secure. For every character you
add to the list of possibilities, you add roughly 60% to the number of possible combinations.