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 .. c:type:: hashkit_hash_fn
19 typedef uint32_t (*hashkit_hash_fn)(const char *key, size_t key_length, void *context);
21 .. c:function:: hashkit_return_t hashkit_set_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm)
23 .. c:function:: hashkit_return_t hashkit_set_custom_function(hashkit_st *hash, hashkit_hash_fn function, void *context)
25 .. c:function:: hashkit_hash_algorithm_t hashkit_get_function(const hashkit_st *hash)
27 .. c:function:: hashkit_return_t hashkit_set_distribution_function(hashkit_st *hash, hashkit_hash_algorithm_t hash_algorithm)
29 .. c:function:: hashkit_return_t hashkit_set_custom_distribution_function(hashkit_st *self, hashkit_hash_fn function, void *context)
31 .. c:function:: hashkit_hash_algorithm_t hashkit_get_distribution_function(const hashkit_st *self)
36 These functions are used to set and retrieve the key and distribution hash functions.
42 :c:func:`hashkit_set_function`, :c:func:`hashkit_set_custom_function` and the distribution equivalents
43 return :c:type:`hashkit_return_t` `HASHKIT_SUCCESS` on success.
45 :c:func:`hashkit_get_function` and :c:func:`hashkit_get_distribution_function` return :c:type:`hashkit_hash_algorithm_t`
46 indicating the hash function used.
53 :manpage:`libhashkit(3)`
54 :manpage:`hashkit_create(3)`
55 :manpage:`hashkit_functions(3)`
60 * :doc:`hashkit_create`
61 * :doc:`hashkit_functions`