On Thu, 21 Sep 2000 15:37:36 -0400 (EDT), Andy Dougherty wrote:

>Still, even for me, I have never encountered a case where I wanted to
>maintain the same rand() sequence and also use a one-arg crypt().
>
>> I will add a note aboput this to the RFC.  If there are no other
>> comments, I will freeze it in 24 hours.
>
>I agree this is a non-issue for this RFC.[*]

Me too, actually. I do think that in the case that crypt() in lazy mode
also uses the same rand() generator as the rest of perl, then the
documentation in perlfunc should mention it.

p.s. how hard can coding a dedicated pseudo-random number generator be?
It's not as if the randomness should be that exceptional, since it only
serves to pick a sequence of two letters (usually).

This code snippet is the whole PRNG, the family known as LCG (see
<http://random.mat.sbg.ac.at/~charly/server/node3.html>):

        $seed = (a * $seed + c) % m;  # a, c, m are constants

$seed, an integer, is also the output of the generator; divide by m to
get a value between 0 (incl) and 1 (excl).

-- 
        Bart.

Reply via email to