Re: MD5 hash query

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 28 Dec 2001 14:22:46 +0100

On Friday 28 December 2001 12.23, Robert Collins wrote:
> from a quick eyeball, you need to feed id, method (An ENUM value) and
> then the URL.
>
> ===
> (unsigned char *) &id, sizeof(id));
> (unsigned char *) &method, sizeof(method));
> (unsigned char *) url, strlen(url));
> ===
>
> So there are unique for a given version of squid (id and method will
> change), and potentially even for different C compilers or platforms.

id is only in private temporary keys.

method is the method enum converted into a single char.

perl, simplified for GET (enum 1) only:

#!/usr/bin/perl -w
use Digest::MD5 qw(md5_hex);
print uc(md5_hex("\1", $ARGV[0])),"\n";
Received on Fri Dec 28 2001 - 06:44:44 MST

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