Date: Sun, 2 Feb 2003 13:23:38 -0800 (PST) From: Doug Barton <DougB@FreeBSD.org> To: Bakul Shah <bakul@bitblocks.com> Cc: current@FreeBSD.org Subject: Re: rand() is broken Message-ID: <20030202131437.V79739@12-234-22-23.pyvrag.nggov.pbz> In-Reply-To: <200302022006.PAA25355@valiant.cnchost.com> References: <200302022006.PAA25355@valiant.cnchost.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2 Feb 2003, Bakul Shah wrote: > Yes, *I* can do it but I don't work at every place they do > simulation! Well the code is still going to be available in cvs. It's not like we're going to magically make it disappear. :) > If in the extreme you are suggesting that a > portable application shouldn't rely on any OS features, you > are of course right but that kind of makes mockery of any > claims of compatibility. The point of compatibility is to > not break interfaces unless there is a significant benefit. I can think of one significant benefit... I had noticed that my perl script to pick random windowmaker themes (which uses rand()) seemed to be picking the same themes over and over again. Now I know why. :) I had to create a "last seen" list to artificially increase the "randomness." Oh wait, TWO benefits... xscreensaver is having the same problem. Seriously though, I think the (vast?) majority of our userbase expects random (or even pseudo-random) numbers to be, well, random. For a sufficiently naive definition of random anyway. While I can certainly sympathize with your needs here, with all due respect I think it's an edge case, and one that could be handled with a little customization on your part. Even if you didn't want a code solution, you could spool off BIGNUM "random" numbers from whatever source you choose and save them to disk so that you could get 100% repeatability. Your needs have more than one solution, but I don't think that depending on rand[om]() not to be random is a good one. Doug -- If it's moving, encrypt it. If it's not moving, encrypt it till it moves, then encrypt it some more. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030202131437.V79739>