Files
libucore/src/ucore_saxhash.c
T
Nils O. Selåsdal cef7e3b057 prefix hash functions with uc_
fix prototype for hashuint
2012-11-01 00:01:53 +01:00

16 lines
223 B
C

#include "ucore_hash.h"
uint32_t
uc_sax_hash(void *key, size_t len)
{
unsigned char *p = key;
unsigned h = 0;
size_t i;
for ( i = 0; i < len; i++ )
h ^= ( h << 5 ) + ( h >> 2 ) + p[i];
return h;
}