Re: [PATCH 13/10] tests for various pack index features
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Apr 11, 2007, 14:51 UTC
- Message-ID
- <20070411145103.GP5436@spearce.org>
- In-Reply-To
- <20070411130932.GA17094@dspnet.fr.eu.org>
Olivier Galibert <galibert@pobox.com> wrote:
Show 11 quoted lines
> On Wed, Apr 11, 2007 at 08:57:09AM -0400, Nicolas Pitre wrote: > > Hmmm what we need is a random data generator that always produces the > > same thing. I'll hack something to replace urandom. > > Don't hack something, ues the standard reference, the Mersenne Twister. > > http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html > > PRNGs are the same as cryptosystems, it's very easy to hack up > something and get it very, very wrong. And it's unnecessary, since > there are very good ones available.
Indeed. But Mersenne Twister doesn't have code to produce a random file of size X given an initial constant seed of Y, does it? A small program to produce X random bytes starting with seed Y still needs to be hacked up.
Probably the smart thing to do here is to embed a copy of MT with constant seeds so we always get the same data file produced on every system, no matter what the implementation of the C library's rand routine is.
Although MT is not GPL. It has its own license, one with a small advertising clause...
-- Shawn.