2 * Copyright (C) 2009 Brian Aker
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
10 This has is Jenkin's "One at A time Hash".
11 http://en.wikipedia.org/wiki/Jenkins_hash_function
14 #include <libhashkit/common.h>
16 uint32_t hashkit_one_at_a_time(const char *key
, size_t key_length
, void *context
)
24 uint32_t val
= (uint32_t) *ptr
++;
26 value
+= (value
<< 10);
27 value
^= (value
>> 6);
29 value
+= (value
<< 3);
30 value
^= (value
>> 11);
31 value
+= (value
<< 15);