Page 1 of 1
random MD5
Posted: Wed Feb 02, 2005 7:55 am
by pelegk2
how can i create random string of md5?
for example like the ones inthe adress bar of this forum
Posted: Wed Feb 02, 2005 12:26 pm
by pickle
Look at the first comment on the PHP manual page for rand(). That gives a good random string. If you want, you can then MD5 that string.
Posted: Wed Feb 02, 2005 1:50 pm
by onion2k
Surely the whole point of MD5 is that its not random..
Posted: Wed Feb 02, 2005 2:08 pm
by patrikG
Posted: Wed Feb 02, 2005 2:29 pm
by hawleyjr
If your just looking for a "random" hash try this:
Code: Select all
$str = md5(time());
or
$str = md5(microtime());
Posted: Wed Feb 02, 2005 7:50 pm
by magicrobotmonkey
what's the point of hashing it if its just random? it seems like a waste of resources.
Posted: Wed Feb 02, 2005 8:49 pm
by hawleyjr
I've done stuff like this before; for example if you need a random 12 dig alphanumeric key for something. I've used:
If there is a better way to do this I'd like to know.....
thnaks alot
Posted: Thu Feb 03, 2005 1:33 am
by pelegk2
all of you for all ofyour idea's