Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Hashing urls with Adler32by Tomte (Priest) |
on May 31, 2007 at 14:40 UTC ( [id://618499]=note: print w/replies, xml ) | Need Help?? |
It produces an output of fixed length for an input of arbitrary length. So there is an infinit set of possible inputs mapped to a finit set of checksums - so the algorithm can't produce a unique checksum for every url you feed it. I suggest you read the article on wikipedia and then have a look at SHA1 as possibly the better solution - that nonetheless will not be bijective either (It will produce collisions!) - it depends on your problem at hand if this is a hindrance.
regards,
An intellectual is someone whose mind watches itself.
In Section
Seekers of Perl Wisdom
|
|