Update changelog information
[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
44 Compile and link with -lmemcachedutil -lmemcached
45
46
47 -----------
48 DESCRIPTION
49 -----------
50
51
52 :c:func:`memcached_generate_hash_value` allows you to hash a key using one of
53 the hash functions defined in the library. This method is provided for
54 the convenience of higher-level language bindings and is not necessary
55 for normal memcache operations.
56
57 The allowed hash algorithm constants are listed in the manpage for
58 :c:func:`memcached_behavior_set`.
59
60 :c:func:`memcached_generate_hash` takes a :c:type:`memcached_st` struture
61 and produces the hash value that would have been generated based on the
62 defaults of :c:type:`memcached_st`.
63
64 As of version 0.36 all hash methods have been placed into the library
65 libhashkit(3) which is linked with libmemcached(3). For more information please see its documentation.
66
67
68 ------
69 RETURN
70 ------
71
72
73 A 32-bit integer which is the result of hashing the given key.
74 For 64-bit hash algorithms, only the least-significant 32 bits are
75 returned.
76
77
78 ----
79 HOME
80 ----
81
82
83 To find out more information please check:
84 `http://libmemcached.org/ <http://libmemcached.org/>`_
85
86
87 ------
88 AUTHOR
89 ------
90
91
92 Brian Aker, <brian@tangent.org>
93
94
95 --------
96 SEE ALSO
97 --------
98
99
100 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`