Quoteing ptkwt / shell1.aracnet.com, on Tue, Jan 21, 2003 at 12:55:13PM +0900:
> A couple of questions:
> 1) how good is Ruby's rand function (what's the quality of randomness)?  I 
> suspec that it is just the same as C's rand, so there won't be a 
> difference.


> 2) I'd like to plug in my own random number generator that would probably 
> produce higher-quality random numbers than the current rand does.  I'm 
> pretty sure it should be doable and easy, like:
> 
>     if not seed
>       #generate @seed using combiation of time, process id and sequence#

You may know this already, but rand() doesn't output random numbers, it
just outputs a sequence of numbers which is *statistically* random.
Netscapes famous SSL security hole was caused by them seeding their
"random" number generator with time and process id, both of which are
pretty easy to guess, since they have limited ranges, and this allowed
their SSL connections to be broken.

Probably your application doesn't need real randomness, you just want
a nice statistical spread, so this won't affect you.

Sam