Re: Sequential Random Character Generator

From: Date: Fri, 27 Feb 2004 16:23:47 +0000
Subject: Re: Sequential Random Character Generator
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-179009@lists.php.net to get a copy of this message
list@pfohlsolutions.com wrote:
I'm trying to create a PHP sequential random character generator that will output to a file database of some sort. The randomization needs to be using both capital letters and numbers. I need to output like 2 million records. Can someone point me in the right direction on how to do this? I'm also looking to to this without letters as well.
First thing, something that is sequential is not random :) Try this function, which I use sometimes function randgen($len) {
    return strtolower(substr(md5(uniqid(time())), 0, $len));
} Sample run [burhan@universe]php -q test.php Random of length 8 : 47e03fef Random of length 10 : 17967d45de Random of length 20 : fbd5711ad011493947bc

« previous php.general (#179009) next »