|
Posted by Alvaro G Vicario on 08/02/05 15:59
*** Peter Fox wrote/escribió (Tue, 2 Aug 2005 09:54:31 +0100):
> Suppose I want to give someone a random password or ID then this is what
> I do:
> (1) Generate a hash, eg. MD5 form something, possibly a random number.
> This gives a string in hex.
> (2) Truncate it to the required number of characters
>
> THEN
> (3) Substitute the characters 0,1,5,8,B,C with eg h,k,p,r,t,w,x,y.
> eg "AB15708" might become "AKTX7YH"
It's a very complicate algorithm to just produce a password that will only
use 16 different characters, isn't it?
http://es.php.net/mt_rand (check the user notes for examples)
http://es.php.net/uniqueid
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Navigation:
[Reply to this message]
|