Libecoli 0.5.0
Extensible COmmand LIne library
Loading...
Searching...
No Matches
Murmurhash

Hash calculation using murmurhash algorithm. More...

Functions

static uint32_t ec_murmurhash_rotl32 (uint32_t x, int8_t r)
static uint32_t ec_murmurhash3_add32 (uint32_t h, uint32_t data)
static uint32_t ec_murmurhash3_mix32 (uint32_t h)
static uint32_t ec_murmurhash3_fmix32 (uint32_t h)
uint32_t ec_murmurhash3 (const void *key, int len, uint32_t seed)

Detailed Description

Hash calculation using murmurhash algorithm.

MurmurHash3 is a hash implementation that was written by Austin Appleby, and is placed in the public domain. The author hereby disclaims copyright to this source code.

Function Documentation

◆ ec_murmurhash_rotl32()

uint32_t ec_murmurhash_rotl32 ( uint32_t x,
int8_t r )
inlinestatic

Hash rotation

Definition at line 22 of file ecoli_murmurhash.h.

◆ ec_murmurhash3_add32()

uint32_t ec_murmurhash3_add32 ( uint32_t h,
uint32_t data )
inlinestatic

Add 32-bit to the hash

Definition at line 28 of file ecoli_murmurhash.h.

◆ ec_murmurhash3_mix32()

uint32_t ec_murmurhash3_mix32 ( uint32_t h)
inlinestatic

Intermediate mix

Definition at line 38 of file ecoli_murmurhash.h.

◆ ec_murmurhash3_fmix32()

uint32_t ec_murmurhash3_fmix32 ( uint32_t h)
inlinestatic

Final mix: force all bits of a hash block to avalanche

Definition at line 46 of file ecoli_murmurhash.h.

◆ ec_murmurhash3()

uint32_t ec_murmurhash3 ( const void * key,
int len,
uint32_t seed )

Calculate a 32-bit murmurhash3

Parameters
keyThe key (the unaligned variable-length array of bytes).
lenThe length of the key, counting by bytes.
seedCan be any 4-byte value initialization value.
Returns
A 32-bit hash.