FreeBSD/usr.bin/grep/regex/hashtable.c
/*
 * Return a 32-bit hash of the given buffer.  The init
 * value should be 0, or the previous hash value to extend
 * the previous hash.
 */
Return a 32-bit hash of the given buffer.  The init
value should be 0, or the previous hash value to extend
the previous hash.
Return a 32 - bit hash of the given buffer . The init value should be 0 or the previous hash value to extend the previous hash .
static uint32_t
hash32_buf(const void *buf, size_t len, uint32_t hash)
{
  const unsigned char *p = buf;
  while (len--)
    hash = HASHSTEP(hash, *p++);
  return hash;
}
static uint32_t hash32_buf ( const void * buf , size_t len , uint32_t hash ) { const unsigned char * p = buf ; while ( len -- ) hash = HASHSTEP ( hash , * p ++ ) ; return hash ; }
Return a 32-bit hash of the given buffer.
Return a 32 - bit hash of the given buffer .