Merge in updates (including removal of some depcrated bits from the examples).
[awesomized/libmemcached] / docs / memcached_generate_hash_value.rst
1 ===============================
2 Generating hash values directly
3 ===============================
4
5
6 Hash a key value
7
8
9 --------
10 SYNOPSIS
11 --------
12
13
14 #include <libmemcached/memcached.h>
15
16 .. c:function:: uint32_t memcached_generate_hash_value (const char *key, size_t key_length, memcached_hash_t hash_algorithm);
17
18 .. c:function:: uint32_t memcached_generate_hash (memcached_st *ptr, const char *key, size_t key_length);
19
20 Compile and link with -lmemcachedutil -lmemcached
21
22
23 -----------
24 DESCRIPTION
25 -----------
26
27
28 memcached_generate_hash_value() allows you to hash a key using one of
29 the hash functions defined in the library. This method is provided for
30 the convenience of higher-level language bindings and is not necessary
31 for normal memcache operations.
32
33 The allowed hash algorithm constants are listed in the manpage for
34 memcached_behavior_set().
35
36 memcached_generate_hash() takes a memcached_st struture and produces
37 the hash value that would have been generated based on the defaults
38 of the memcached_st structure.
39
40 As of version 0.36 all hash methods have been placed into the library
41 libhashkit(3) which is linked with libmemcached(3). For more information please see its documentation.
42
43
44 ------
45 RETURN
46 ------
47
48
49 A 32-bit integer which is the result of hashing the given key.
50 For 64-bit hash algorithms, only the least-significant 32 bits are
51 returned.
52
53
54 ----
55 HOME
56 ----
57
58
59 To find out more information please check:
60 `http://libmemcached.org/ <http://libmemcached.org/>`_
61
62
63 ------
64 AUTHOR
65 ------
66
67
68 Brian Aker, <brian@tangent.org>
69
70
71 --------
72 SEE ALSO
73 --------
74
75
76 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`