Code cleanup
This commit is contained in:
@@ -3007,25 +3007,3 @@ u_int32_t ndpi_nearest_power_of_two(u_int32_t x) {
|
||||
return(x);
|
||||
}
|
||||
|
||||
/* ********************************************************** */
|
||||
|
||||
/*
|
||||
https://en.wikipedia.org/wiki/Jenkins_hash_function
|
||||
|
||||
See also http://burtleburtle.net/bob/hash/spooky.html
|
||||
*/
|
||||
u_int32_t ndpi_hash_string(char *str) {
|
||||
u_int32_t hash, i;
|
||||
|
||||
for(hash = i = 0; str[i] != '\0'; ++i) {
|
||||
hash += str[i];
|
||||
hash += (hash << 10);
|
||||
hash ^= (hash >> 6);
|
||||
}
|
||||
|
||||
hash += (hash << 3);
|
||||
hash ^= (hash >> 11);
|
||||
hash += (hash << 15);
|
||||
|
||||
return(hash);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user