16 lines
223 B
C
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;
|
|
}
|
|
|