Names to ids

Nigel Rantor wiggly at wiggly.org
Wed Jan 25 15:53:31 GMT 2006


Simon Wistow wrote:
> But this means that we need to have a consistent filename to integer 
> mapping so that it remains consistent between runs. This means that 
> collisions should be kept to an absolute minimum because if a totally 
> black image's filename gets mapped to id 88888 and then a totally white 
> image's filename gets mapped to the same then we're going to get 
> very bogus results.

In that case hashing is out because you *will* get collisions (I speak 
from experience). Probably more of them than you assume.

The distance/difference between two images is not going to be related to 
the distance between their hash values anyway so simply thinking about 
the case where two very dissimilar images hash values collide is silly.

In this case I'd go for creating an index (file/db/whatever) to map 
names -> id

   n


More information about the london.pm mailing list