4 .. index:: object: hashkit_st
5 .. index:: object: hashkit_hash_fn
7 Set hash functions to use for calculating values for keys
12 #include <libhashkit-|libhashkit_version|/hashkit.h>
13 Compile and link with -lhashkit
15 .. type:: uint32_t (*hashkit_hash_fn)(const char *key, size_t key_length, void *context)
17 .. function:: hashkit_return_t hashkit_set_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm)
19 .. function:: hashkit_return_t hashkit_set_custom_function(hashkit_st *hash, hashkit_hash_fn function, void *context)
21 .. function:: hashkit_hash_algorithm_t hashkit_get_function(const hashkit_st *hash)
23 .. function:: hashkit_return_t hashkit_set_distribution_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm)
25 .. function:: hashkit_return_t hashkit_set_custom_distribution_function(hashkit_st *self, hashkit_hash_fn function, void *context)
27 .. function:: hashkit_hash_algorithm_t hashkit_get_distribution_function(const hashkit_st *self)
32 These functions are used to set and retrieve the key and distribution hash functions.
38 :func:`hashkit_set_function`, :func:`hashkit_set_custom_function` and the distribution equivalents
39 return :type:`hashkit_return_t` `HASHKIT_SUCCESS` on success.
41 :func:`hashkit_get_function` and :func:`hashkit_get_distribution_function` return :type:`hashkit_hash_algorithm_t`
42 indicating the hash function used.
49 :manpage:`libhashkit(3)`
50 :manpage:`hashkit_create(3)`
51 :manpage:`hashkit_functions(3)`
55 * :doc:`../libhashkit`
56 * :doc:`hashkit_create`
57 * :doc:`hashkit_functions`