Merge bzr://10.0.3.21 Build: jenkins-Libmemcached-469
[awesomized/libmemcached] / docs / memcached_generate_hash_value.rst
1 ===============================
2 Generating hash values directly
3 ===============================
4
5 .. index:: object: memcached_st
6
7 Hash a key value
8
9
10 --------
11 SYNOPSIS
12 --------
13
14
15 #include <libmemcached/memcached.h>
16
17 .. c:type:: memcached_hash_t
18
19 .. c:function:: uint32_t memcached_generate_hash_value (const char *key, size_t key_length, memcached_hash_t hash_algorithm)
20
21 .. c:function:: uint32_t memcached_generate_hash (memcached_st *ptr, const char *key, size_t key_length)
22
23 .. c:type:: MEMCACHED_HASH_DEFAULT
24
25 .. c:type:: MEMCACHED_HASH_MD5
26
27 .. c:type:: MEMCACHED_HASH_CRC
28
29 .. c:type:: MEMCACHED_HASH_FNV1_64
30
31 .. c:type:: MEMCACHED_HASH_FNV1A_64
32
33 .. c:type:: MEMCACHED_HASH_FNV1_32
34
35 .. c:type:: MEMCACHED_HASH_FNV1A_32
36
37 .. c:type:: MEMCACHED_HASH_JENKINS
38
39 .. c:type:: MEMCACHED_HASH_MURMUR
40
41 .. c:type:: MEMCACHED_HASH_HSIEH
42
43 .. c:type:: MEMCACHED_HASH_MURMUR3
44
45
46 Compile and link with -lmemcachedutil -lmemcached
47
48
49 -----------
50 DESCRIPTION
51 -----------
52
53
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.
58
59 The allowed hash algorithm constants are listed in the manpage for
60 :c:func:`memcached_behavior_set`.
61
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`.
65
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.
68
69
70 ------
71 RETURN
72 ------
73
74
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
77 returned.
78
79
80 ----
81 HOME
82 ----
83
84
85 To find out more information please check:
86 `http://libmemcached.org/ <http://libmemcached.org/>`_
87
88
89 ------
90 AUTHOR
91 ------
92
93
94 Brian Aker, <brian@tangent.org>
95
96
97 --------
98 SEE ALSO
99 --------
100
101
102 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`