1 ===============================
2 Generating hash values directly
3 ===============================
5 .. index:: object: memcached_st
15 #include <libmemcached/memcached.h>
17 .. c:function:: uint32_t memcached_generate_hash_value (const char *key, size_t key_length, memcached_hash_t hash_algorithm);
19 .. c:function:: uint32_t memcached_generate_hash (memcached_st *ptr, const char *key, size_t key_length);
21 Compile and link with -lmemcachedutil -lmemcached
29 :c:func:`memcached_generate_hash_value()` allows you to hash a key using one of
30 the hash functions defined in the library. This method is provided for
31 the convenience of higher-level language bindings and is not necessary
32 for normal memcache operations.
34 The allowed hash algorithm constants are listed in the manpage for
35 :c:func:`memcached_behavior_set()`.
37 :c:func:`memcached_generate_hash()` takes a :c:type:`memcached_st` struture
38 and produces the hash value that would have been generated based on the
39 defaults of the :c:type:`memcached_st structure`.
41 As of version 0.36 all hash methods have been placed into the library
42 libhashkit(3) which is linked with libmemcached(3). For more information please see its documentation.
50 A 32-bit integer which is the result of hashing the given key.
51 For 64-bit hash algorithms, only the least-significant 32 bits are
60 To find out more information please check:
61 `http://libmemcached.org/ <http://libmemcached.org/>`_
69 Brian Aker, <brian@tangent.org>
77 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`