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 they think... but there's no Strings class AFAIK, and
> I think they'll hesitate to create a top-level class for just
> one function. :)
>
> At 16:47 8/5/2001, Daniel Andersson wrote the following:
> --------------------------------------------------------------
> >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 on basis of
> >> usefulness, not the "coolness" factor. IMNSHO this function
> >> isn't very useful, and it is extremely easy to implement in
> >> userland:
> >>
> >> function str_rand()
> >> {
> >> $len = func_num_args() ? func_get_arg(0) : 32 ;
> >> return substr(md5(microtime()),0,$len);
> >> }
> >>
> >> At 13:57 8/5/2001, Daniel Andersson wrote the following:
> >> --------------------------------------------------------------
> >> >i would say so, yes.
> >> >
> >> >and if you do md5(microtime()) you have to do a substr() on the result
to
> >> >get the desired length.
> >> >
> >> >easy done, yes. but still..
> >> >
> >> >maybe something 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 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 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 [l|r]trim) syntax.
> >> >> >> Charlist defaults to 0..9a..zA..Z
> >> >> >>
> >> >> >>
> >> >> >> IMHO, this would be a very useful function.
> >> >> >>
> >> >> >> Any comments? Maybe not min&maxlen, but simply a fixed len?
(since
> >> >> >> randomness on the length is ambigious to implement, there are
less
> >> >> >> possibilities with shorter strings, which raises some issues).
> >> >> >>
> >> >> >> As an extension, the function could also accept an array as
> >charlist,
> >> >> >> containing small strings, to produce pronouncable strings.
> >> >> >>
> >> >> >> Jeroen
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]