From 3258cf3f11bf7c68a2e69e1808c4551cc899725a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 24 Sep 2010 15:34:06 +0930 Subject: tdb: add Bob Jenkins lookup3 hash as helper hash. This is a better hash than the default: shipping it with tdb makes it easy for callers to use it as the hash by passing it to tdb_open_ex(). This version taken from CCAN and modified, which took it from http://www.burtleburtle.net/bob/c/lookup3.c. Signed-off-by: Rusty Russell --- lib/tdb/include/tdb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/tdb/include') diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h index 050f398eec..08b6b3ab55 100644 --- a/lib/tdb/include/tdb.h +++ b/lib/tdb/include/tdb.h @@ -142,6 +142,7 @@ _PUBLIC_ void tdb_add_flags(struct tdb_context *tdb, unsigned flag); _PUBLIC_ void tdb_remove_flags(struct tdb_context *tdb, unsigned flag); _PUBLIC_ void tdb_enable_seqnum(struct tdb_context *tdb); _PUBLIC_ void tdb_increment_seqnum_nonblock(struct tdb_context *tdb); +_PUBLIC_ unsigned int tdb_jenkins_hash(TDB_DATA *key); _PUBLIC_ int tdb_check(struct tdb_context *tdb, int (*check) (TDB_DATA key, TDB_DATA data, void *private_data), void *private_data); -- cgit