1 /* SPDX-License-Identifier: LicenseRef-lookup3-public-domain */
2 #pragma once
3 
4 #include <inttypes.h>
5 #include <sys/types.h>
6 
7 #include "macro.h"
8 
9 uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initval) _pure_;
10 void jenkins_hashword2(const uint32_t *k, size_t length, uint32_t *pc, uint32_t *pb);
11 
12 uint32_t jenkins_hashlittle(const void *key, size_t length, uint32_t initval) _pure_;
13 void jenkins_hashlittle2(const void *key, size_t length, uint32_t *pc, uint32_t *pb);
14 
15 uint32_t jenkins_hashbig(const void *key, size_t length, uint32_t initval) _pure_;
16 
jenkins_hash64(const void * data,size_t length)17 static inline uint64_t jenkins_hash64(const void *data, size_t length) {
18         uint32_t a = 0, b = 0;
19 
20         jenkins_hashlittle2(data, length, &a, &b);
21 
22         return ((uint64_t) a << 32ULL) | (uint64_t) b;
23 }
24