Re: Multiple random number generators (was Re: RFC 208 (v2) crypt() default salt)

2000-09-17 Thread Bart Lateur

On 16 Sep 2000 22:40:24 -0400, Chaim Frenkel wrote:

>BL> Therefore, crypt() should have it's own pseudo-random generator. A
>BL> simple task, really: same code, but a different seed variable.
>
>Should rand be extended to be able to support multiple random number
>generators?

Not just srand().

Actually, if you want this, this is an excellent candidate for the
"every primitive should be an oject" idea: make a random number
generator an object. Each one can easily have it's own inter-independent
sequence.

-- 
Bart.



Multiple random number generators (was Re: RFC 208 (v2) crypt() default salt)

2000-09-17 Thread Chaim Frenkel

> "BL" == Bart Lateur <[EMAIL PROTECTED]> writes:

BL> Therefore, crypt() should have it's own pseudo-random generator. A
BL> simple task, really: same code, but a different seed variable.

Should rand be extended to be able to support multiple random number
generators?

=item srand EXPR, RANDGEN_REF
=item srand EXPR
=item srand

Srand would now return a reference to a random number
generator. Calling srand in a void context would effect the global
default random number generator. But in a non-void context would
create a new random number generator, and return a reference to the
generator allowing reseting or extraction of the next number via rand


=item rand EXPR, RANDGEN_REF
=item rand EXPR
=item rand


-- 
Chaim FrenkelNonlinear Knowledge, Inc.
[EMAIL PROTECTED]   +1-718-236-0183