return (1103515243 * value + 12345);
}
+static unsigned int jenkins_hash(TDB_DATA *key)
+{
+ return hash_any(key->dptr, key->dsize, 0);
+}
/* initialise a new database with a specified hash size */
static int tdb_new_database(struct tdb_context *tdb, int hash_size)
tdb->hash_fn = hash_fn;
hash_alg = "user_defined";
} else {
- tdb->hash_fn = default_tdb_hash;
- hash_alg = "default";
+ if (tdb_flags & TDB_CLEAR_IF_FIRST) {
+ tdb->hash_fn = jenkins_hash;
+ hash_alg = "jenkins";
+ } else {
+ tdb->hash_fn = default_tdb_hash;
+ hash_alg = "default";
+ }
}
/* cache the page size */