What happens if we have a hash collision

Jesus Cea jcea at jcea.es
Fri May 7 23:41:07 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

With regular commands (like -r parameter, or "hg log", etc), Mercurial
only shows 48 bits of the hash.

According to birthday paradox, having a few thousands of changesets will
have a pretty high (statistically) probability of collision, if we only
use 48 bits from the hash: <http://en.wikipedia.org/wiki/Birthday_problem>.

I know internally mercurial uses 160 bits (for instance, in tags), but
what it could happen if I do a "hg log" or a "hg pull -r" with a
truncated hash with a collision?.

Does Mercurial recognize the fact and force you to use the 160 bits in
that case?.

- -- 
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
.                              _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQCVAwUBS+SlEplgi5GaxT1NAQJPJAP9HZZs7PHP1i7SZiaXFmtc+idwkZXcl+Vd
K+5fSIwAO/GXB6JiLw9lb1ycKoR/Fne6pX6ZTta9o2WCK+Fng4QH3FzFZaXCpuWO
HUbL3SVt0kPBdd9g1Lbl8JiPnuwgESjgOPdh1Bd54zuik/bkmfbRlkBuHvZUoXZ7
cDbV8pEZ1Vs=
=T2xN
-----END PGP SIGNATURE-----



More information about the Mercurial mailing list