X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Fhash.c;h=745f04c87e5574f50719b3018b4a78f7167fbbd6;hb=703cea0c78a896c658272af06306218fc0bb23cc;hp=b1307d985bef413edc2ebea3bb0fe2eaec4e16b0;hpb=007a7e4e8df8f43c61126599bcc582750cbf17fe;p=ccan diff --git a/ccan/tdb2/hash.c b/ccan/tdb2/hash.c index b1307d98..745f04c8 100644 --- a/ccan/tdb2/hash.c +++ b/ccan/tdb2/hash.c @@ -17,26 +17,10 @@ */ #include "private.h" #include -#include - -static uint64_t jenkins_hash(const void *key, size_t length, uint64_t seed, - void *arg) -{ - uint64_t ret; - /* hash64_stable assumes lower bits are more important; they are a - * slightly better hash. We use the upper bits first, so swap them. */ - ret = hash64_stable((const unsigned char *)key, length, seed); - return (ret >> 32) | (ret << 32); -} - -void tdb_hash_init(struct tdb_context *tdb) -{ - tdb->hashfn = jenkins_hash; -} uint64_t tdb_hash(struct tdb_context *tdb, const void *ptr, size_t len) { - return tdb->hashfn(ptr, len, tdb->hash_seed, tdb->hash_data); + return tdb->hash_fn(ptr, len, tdb->hash_seed, tdb->hash_data); } uint64_t hash_record(struct tdb_context *tdb, tdb_off_t off)