httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@ast.cam.ac.uk (David Robinson)
Subject Re: Proxy module available... use at own risk.
Date Mon, 22 Jan 1996 18:17:00 GMT
I see it uses this hash function...

char *hash(pool *p, const char *it) {
 int i, hval[4], j, k = 0;
 char val[33];

 hval[0] = 0xae4207b2;
 hval[1] = 0xb8edd9cf;
 hval[2] = 0x03377f26;
 hval[3] = 0x6bce688a;

 for(i = strlen(it); i; i--) {
  hval[i%4] ^= (*(it++))^(i%4);
  hval[i%4] = (hval[i%4] << 3) + (hval[i%4] >> 29);
 }

 for(i = 0; i <= 3; i++) {
   for(j = 0; j <= 7; j++) {
     val[k++] = ((hval[i]>>(4*j))&0x0f) + 'a';
   }
 }
 val[k++] = '\0';

 return pstrdup(p, val);
}

Isn't
  hval[i%4] ^= (*(it++))^(i%4);
equivalent to
  hval[i%4]  = *(it++);
????

 David.

Mime
View raw message