monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: RFC: Fake IDs


From: Nathaniel Smith
Subject: Re: [Monotone-devel] Re: RFC: Fake IDs
Date: Tue, 18 Jul 2006 18:23:01 -0700
User-agent: Mutt/1.5.11+cvs20060403

On Tue, Jul 18, 2006 at 05:24:08PM -0700, Graydon Hoare wrote:
> Zack Weinberg wrote:
> >There are a small number of places that need a fake ID of some variety
> >(ignoring all the unit tests, which use 'em heavily) and we currently
> >just pick a "random" 160-bit number.   I need to add a few more of
> >these, so I thought it would be a good idea to have a principled way
> >of generating them.  The  implementation I've picked is to have
> >vocab.hh provide a fake_id() function/macro that hashes __FILE__ and
> >__LINE__.
> 
> Eh.. I'd prefer to turn those cases where we pick fake IDs to actually 
> loop, checking the db for a collision. It feels weird to be hard-coding 
> collision conditions into the binary, however unlikely.

If we don't trust SHA1, why are we using it at all? :-)

If we hash some text, and then compare it to another equal-length
bitstring... the collision probability is not affected by whether that
other bitstrings was generated by pounding on the keyboard or by SHA1
of some other text.  Am I missing something in this analysis?

-- Nathaniel

-- 
"...these, like all words, have single, decontextualized meanings: everyone
knows what each of these words means, everyone knows what constitutes an
instance of each of their referents.  Language is fixed.  Meaning is
certain.  Santa Claus comes down the chimney at midnight on December 24."
  -- The Language War, Robin Lakoff




reply via email to

[Prev in Thread] Current Thread [Next in Thread]