PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, August 05, 2001 3:41
Subject: Re: [PHP-DEV] Re: rand_str
is it that much more useful than md5(microtime()) ?
ah-oh, you want to be able to specify the set of characters...
At 04:28 8/5/2001, Daniel Andersson wrote the following
for PEAR instead of the core?
/ d
- Original Message -
From: Cynic [EMAIL PROTECTED]
To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, August 05, 2001 3:41
Subject: Re: [PHP-DEV] Re: rand_str
is it that much more useful than md5(microtime()) ?
ah-oh, you want
yes, totally agree.
but why not put it into PEAR?
/ d
- Original Message -
From: Cynic [EMAIL PROTECTED]
To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, August 05, 2001 13:52
Subject: Re: [PHP-DEV] Re: rand_str
I think that new functions should be added
:
--
yes, totally agree.
but why not put it into PEAR?
/ d
- Original Message -
From: Cynic [EMAIL PROTECTED]
To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, August 05, 2001 13:52
Subject: Re: [PHP-DEV] Re: rand_str
I think that new functions
heh.. possibly. ;)
forwarded.
/ d
- Original Message -
From: Cynic [EMAIL PROTECTED]
To: Daniel Andersson [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, August 05, 2001 15:59
Subject: Re: [PHP-DEV] Re: rand_str
I'm not against putting it into pear. ask the pear guys
what
but why not put it into PEAR?
PEAR can be useful, but the power of PHP is, that is has so many helpful
build-in functions. And with pear, it will always be longer.
I think that new functions should be added on basis of
usefulness, not the coolness factor. IMNSHO this function
isn't very
At 17:21 8/5/2001, Jeroen van Wolffelaar wrote the following:
--
but why not put it into PEAR?
PEAR can be useful, but the power of PHP is, that is has so many helpful
build-in functions. And with pear, it will always be longer.
I
and it is extremely easy to implement in
userland:
That is not true,
So how about this?
function str_rand($len=8)
{
$retval = strtr(md5(microtime()), chr(0x30), chr(0x4F));
return substr($retval,0,$len);
}
for($i=0; $i10; $i++){
echo str_rand(), \n;
}
I find
At 21:17 8/5/2001, Jeroen van Wolffelaar wrote the following:
--
[...]
function str_rand($len=8)
{
$retval = strtr(md5(microtime()), chr(0x30), chr(0x4F));
return substr($retval,0,$len);
}
for($i=0; $i10; $i++){
Hi Jeroen,
I think we're not on the same page. :) I consider both versions
of str_rand() I posted trivial...
Agree. But they are not what rand_str could do. The result has
16 different chars, just because md5 happens to have that much.
Implementing something that has NOT that limitation, is
At 21:53 8/5/2001, Jeroen van Wolffelaar wrote the following:
--
Hi Jeroen,
I think we're not on the same page. :) I consider both versions
of str_rand() I posted trivial...
Agree. But they are not what rand_str could do. The
Implementing something that has NOT that limitation, is far less trivial.
function str_rand($len = 8, $class = 'a-zA-Z1-9')
{
static $init = 1;
if(1 == $init){
mt_srand((double) microtime() * 100);
$init = 0;
}
$chars = array();
for($i = 0; $i
At 22:50 8/5/2001, Jeroen van Wolffelaar wrote the following:
--
Implementing something that has NOT that limitation, is far less trivial.
function str_rand($len = 8, $class = 'a-zA-Z1-9')
{
static $init = 1;
if(1 ==
Developers Mailing List [EMAIL PROTECTED]
Sent: Sunday, August 05, 2001 5:16 PM
Subject: Re: [PHP-DEV] Re: rand_str
At 22:50 8/5/2001, Jeroen van Wolffelaar wrote the following:
--
Implementing something that has NOT that limitation, is far
sounds useful and cool, me thinks :o)
/ d
[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi,
I'm thinking about a new function: [mt_]rand_str
Syntax:
string [mt_]rand_str(minlen,maxlen[,charlist]);
where charlist is in addcslashes (and now also
is it that much more useful than md5(microtime()) ?
ah-oh, you want to be able to specify the set of characters...
At 04:28 8/5/2001, Daniel Andersson wrote the following:
--
sounds useful and cool, me thinks :o)
/ d
[EMAIL
16 matches
Mail list logo