24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 * POSSIBILITY OF SUCH DAMAGE. |
26 * POSSIBILITY OF SUCH DAMAGE. |
27 */ |
27 */ |
28 /** |
28 /** |
29 * \file hash_key.h |
29 * @file hash_key.h |
30 * \brief Interface for map implementations. |
30 * @brief Interface for map implementations. |
31 * \author Mike Becker |
31 * @author Mike Becker |
32 * \author Olaf Wintermann |
32 * @author Olaf Wintermann |
33 * \copyright 2-Clause BSD License |
33 * @copyright 2-Clause BSD License |
34 */ |
34 */ |
35 |
35 |
36 |
36 |
37 #ifndef UCX_HASH_KEY_H |
37 #ifndef UCX_HASH_KEY_H |
38 #define UCX_HASH_KEY_H |
38 #define UCX_HASH_KEY_H |
60 * Type for a hash key. |
60 * Type for a hash key. |
61 */ |
61 */ |
62 typedef struct cx_hash_key_s CxHashKey; |
62 typedef struct cx_hash_key_s CxHashKey; |
63 |
63 |
64 /** |
64 /** |
65 * Computes a murmur2 32 bit hash. |
65 * Computes a murmur2 32-bit hash. |
66 * |
66 * |
67 * You need to initialize \c data and \c len in the key struct. |
67 * You need to initialize @c data and @c len in the key struct. |
68 * The hash is then directly written to that struct. |
68 * The hash is then directly written to that struct. |
69 * |
69 * |
70 * \note If \c data is \c NULL, the hash is defined as 1574210520. |
70 * Usually you should not need this function. |
|
71 * Use cx_hash_key(), instead. |
|
72 * |
|
73 * @note If @c data is @c NULL, the hash is defined as 1574210520. |
71 * |
74 * |
72 * @param key the key, the hash shall be computed for |
75 * @param key the key, the hash shall be computed for |
|
76 * @see cx_hash_key() |
73 */ |
77 */ |
74 cx_attr_nonnull |
78 cx_attr_nonnull |
75 void cx_hash_murmur(CxHashKey *key); |
79 void cx_hash_murmur(CxHashKey *key); |
76 |
80 |
77 /** |
81 /** |