1 ===============================
2 Generating hash values directly
3 ===============================
5 .. index:: object: memcached_st
15 #include <libmemcached/memcached.h>
17 .. c:type:: memcached_hash_t
19 .. c:function:: uint32_t memcached_generate_hash_value (const char *key, size_t key_length, memcached_hash_t hash_algorithm)
21 .. c:function:: uint32_t memcached_generate_hash (memcached_st *ptr, const char *key, size_t key_length)
23 .. c:type:: MEMCACHED_HASH_DEFAULT
25 .. c:type:: MEMCACHED_HASH_MD5
27 .. c:type:: MEMCACHED_HASH_CRC
29 .. c:type:: MEMCACHED_HASH_FNV1_64
31 .. c:type:: MEMCACHED_HASH_FNV1A_64
33 .. c:type:: MEMCACHED_HASH_FNV1_32
35 .. c:type:: MEMCACHED_HASH_FNV1A_32
37 .. c:type:: MEMCACHED_HASH_JENKINS
39 .. c:type:: MEMCACHED_HASH_MURMUR
41 .. c:type:: MEMCACHED_HASH_HSIEH
43 .. c:type:: MEMCACHED_HASH_MURMUR3
46 Compile and link with -lmemcachedutil -lmemcached
54 :c:func:`memcached_generate_hash_value` allows you to hash a key using one of
55 the hash functions defined in the library. This method is provided for
56 the convenience of higher-level language bindings and is not necessary
57 for normal memcache operations.
59 The allowed hash algorithm constants are listed in the manpage for
60 :c:func:`memcached_behavior_set`.
62 :c:func:`memcached_generate_hash` takes a :c:type:`memcached_st` struture
63 and produces the hash value that would have been generated based on the
64 defaults of :c:type:`memcached_st`.
66 As of version 0.36 all hash methods have been placed into the library
67 libhashkit(3) which is linked with libmemcached(3). For more information please see its documentation.
75 A 32-bit integer which is the result of hashing the given key.
76 For 64-bit hash algorithms, only the least-significant 32 bits are
85 To find out more information please check:
86 `http://libmemcached.org/ <http://libmemcached.org/>`_
94 Brian Aker, <brian@tangent.org>
102 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`