Phil Palmieri wrote:
This is what i am using currently (i always check the DB for dupes
first) --
$random = md5 (uniqid (rand()));
I have never had a duplicate alpha-numeric random yet and i am up to
500,000
This method is far from random, even when you haven't got one single
duplicate yet.
uniqid () is based on microtime (i.e. predictable) and rand () does not
exceed the range of an integer.
Also rand() which stems from the original libc branch is considered slow and
not very random indeed.
If you need something more random u might check out the mt_rand() function
(mt stands for Mersenne Twister, after the algorithm used for producing
random values).
For good randomness in cardgames sims I need either a true random source or
a pRNG with a range way higher than rand(). Most cardgame sites use advanced
PRNG's mixed with random info such as user mouse movement data, timeout
values et cetera.
Of course all this is not required for simple usage, but for some uses (such
as commercial pokerware) it simply won't do. Thanks for your input too Phil!
Regds
Pjotr