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
16 uint32_t hashkit_one_at_a_time(const char *key
, size_t key_length
, void *context
__attribute__((unused
)))
23 uint32_t val
= (uint32_t) *ptr
++;
25 value
+= (value
<< 10);
26 value
^= (value
>> 6);
28 value
+= (value
<< 3);
29 value
^= (value
>> 11);
30 value
+= (value
<< 15);