hash string.
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1804
d4fa192b-c00b-0410-8231-
f00ffab90ce4
char **ParseArgv(const char *s, int comment);
/* from libvarnish/crc32.c */
+uint32_t crc32(uint32_t crc, const void *p1, unsigned l);
uint32_t crc32_l(const void *p1, unsigned l);
/* from libvarnish/time.c */
};
uint32_t
-crc32_l(const void *p1, unsigned l)
+crc32(uint32_t crc, const void *p1, unsigned l)
{
const unsigned char *p;
- uint32_t crc;
-
- crc = ~0U;
for (p = (const unsigned char*)p1; l-- > 0; p++)
crc = (crc >> 8) ^ crc32bits[(crc ^ *p) & 0xff];
+ return (crc);
+}
+
+uint32_t
+crc32_l(const void *p1, unsigned l)
+{
+ uint32_t crc;
+
+ crc = crc32(~0U, p1, l);
return (crc ^ ~0U);
}
+