On Wed, 2004-12-29 at 18:10, Ben Tilly wrote:

> Under normal circumstances, to get non-miniscule odds of having
> a collision somewhere between MD5 keys, you'd need about 2**64
> keys.  If you have less than, say, a billion keys then you can ignore
> that possibility for all practical intents and purposes.

I understand risk assessment and the idea that nothing is 100% safe, but
when you have a situation where you KNOW from day one that some keys
will collide, and your data will be corrupted, you don't build that into
your system if you have an easy out.

This is hashing 101. You hash, you bucket based on the hashes, and then
you store a list at each bucket with key and value tuple for a linear
search. There are other ways to do it, but this is the classic.

Of course, Perl does this for you. That extra time that I measured is
almost certainly the time spent comparing the two strings, which your
tie interface will also have to do because of collisions.

-- 
â 781-324-3772
â [EMAIL PROTECTED]
â http://www.ajs.com/~ajs

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to