summaryrefslogtreecommitdiff
path: root/src/libstddjb/cdb_hash.c
blob: 3849f02a571a62c69b07ceb6f3f22dae358fd7c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

#include <stdint.h>

#include "cdb-internal.h"

uint32_t cdb_hash (char const *buf, uint32_t len)
{
  uint32_t h = CDB_HASHSTART ;
  while (len--) h = cdb_hashadd(h, *buf++) ;
  return h ;
}