MD5 hash query

From: Joe Cooper <joe@dont-contact.us>
Date: Fri, 28 Dec 2001 05:21:35 -0600

Hello all,

I'm writing a set of perl scripts to build an index of a running Squid
cache based on data from the store.log...Because I'd like to keep the
database in the form of a (fast) key=value Berkeley DB, I want to
reference objects by their MD5.

Problem is, I can't seem to get the perl Digest::MD5 module to generate
an MD5 that matches Squids MD5 output for a URL. I'm using the md5_hex
function, which generates a 32-byte hash of hexadecimal characters that
/looks/ like it ought to match up, but they don't. I've tried stripping
the 'http://' part of the request, as well as hashing the whole URL,
'http://' and all. Neither results in a match.

I see from store_key_md5.c that the method and the url are being
hashed...but combining the two into the Perl Digest::MD5 module using
the add method or simply concatenating the two strings isn't working
either (though the interface appears the same as the one in the RSA code
being used in Squid--but my grasp of the underlying code in either is
not enough to say that the interfaces should behave the same).

Is there some processing happening to the URL or method before hashing,
that I'm not seeing--such as converting to all lowercase or something?

Thanks for any pointers anyone can throw my way. I think I'm pretty
well stumped on this one.

-- 
Joe Cooper <joe@swelltech.com>
http://www.swelltech.com
Web Caching Appliances and Support
Received on Fri Dec 28 2001 - 04:20:04 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:42 MST