git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Olivier Galibert <galibert@pobox.com>
Cc: Nicolas Pitre <nico@cam.org>, Junio C Hamano <junkio@cox.net>,
	git@vger.kernel.org
Subject: Re: [PATCH 13/10] tests for various pack index features
Date: Wed, 11 Apr 2007 10:51:03 -0400	[thread overview]
Message-ID: <20070411145103.GP5436@spearce.org> (raw)
In-Reply-To: <20070411130932.GA17094@dspnet.fr.eu.org>

Olivier Galibert <galibert@pobox.com> wrote:
> 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.

  reply	other threads:[~2007-04-11 14:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-10 20:26 [PATCH 13/10] tests for various pack index features Nicolas Pitre
2007-04-11  2:57 ` Junio C Hamano
2007-04-11 12:57   ` Nicolas Pitre
2007-04-11 13:09     ` Olivier Galibert
2007-04-11 14:51       ` Shawn O. Pearce [this message]
2007-04-11 17:29         ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070411145103.GP5436@spearce.org \
    --to=spearce@spearce.org \
    --cc=galibert@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).