Names to ids

Paul Makepeace london.pm.org at paulm.com
Wed Jan 25 14:05:43 GMT 2006


Je 2006-01-25 13:40:29 +0000, Simon Wistow skribis:
> My first thought (md5_hex the name and then hex the reuslt to get an 
> integer) gets an overflow error unless I truncate to the first 8 
> characters.

This is what I would do. No part of the MD5 is any more or less random
or likely to produce collisions than any other bits (AIUI), and any
algorithm that we could come up with are subject to your integer limit
restriction. So it comes down to: is MD5 fast enough for you.

What's the rationale for the requirement to hash to an integer rather
than leave it as is / base 62 / whatever else?

Paul

-- 
Paul Makepeace .............................. http://paulm.com/inchoate/

"What is do I smell? London bridge is coming down."
   -- http://paulm.com/toys/surrealism/


More information about the london.pm mailing list