Files
libucore/src/saxhash.c
T
2013-03-06 22:22:04 +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;
}