Loading...
Searching...
No Matches
murmur_hash.h File Reference
`#include <stdint.h>`
`#include <mptcpd/export.h>`
Include dependency graph for murmur_hash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

MPTCPD_API unsigned int | mptcpd_murmur_hash3 (void const *key, int len, uint32_t seed)
| Generate hash of key using the MurmurHash3 algorithm.

## Detailed Description

This file incorporates work covered by the following notice: MurmurHash3 was written by Austin Appleby, and is placed in the public domain. The author hereby disclaims copyright to this source code.

Changes relative to the original:

- 128 bit hash functions were removed. They are not needed by mptcpd since the ELL l_hashmap expects hash values of type `unsigned` `int`.
- The `MurmurHash3_x86_32()` function was renamed to `mptcpd_murmur_hash3()`.
- The hash value is returned as an @ `unsigned` `int` return value instead of a `void*` function "out" parameter.
- The coding style was modified to conform to the mptcpd style.

See also
  https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.h

## Function Documentation

## mptcpd_murmur_hash3()

MPTCPD_API unsigned int mptcpd_murmur_hash3 | ( | void const * | key,
|  | int | len,
|  | uint32_t | seed
| ) |  |

Generate hash of key using the MurmurHash3 algorithm.

Parameters

  [in] | key | Key value to be hashed.
  [in] | len | Length of key in bytes.
  [in] | seed | Initial value of hash prior to hashing key.

Returns
  Hash of key.

Attention
  The generated hash value is not cryptographically strong.

See also
  https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp