libmoost
moost::hash::murmur3 Class Reference

#include <murmur3.hpp>

List of all members.

Classes

struct  hash32

Static Public Member Functions

static uint32_t compute32 (const void *key, size_t len, uint32_t seed)
template<typename T >
static uint32_t compute32 (const T &key, uint32_t seed)
static uint32_t compute32 (const std::string &key, uint32_t seed)
template<typename T >
static uint32_t compute32 (const std::vector< T > &key, uint32_t seed)

Static Private Member Functions

static uint32_t fmix (uint32_t h)
static uint32_t getblock (const uint32_t *p, int i)
static uint32_t rotl32 (uint32_t x, int8_t r)

Detailed Description

Fast murmur3 hash implementation

This class implements the 32-bit murmur3 hash algorithm and is in fact derived from the original code:

https://github.com/PeterScott/murmur3

The main difference is that the template function compute32() can be more easily optimised by the compiler. Especially if you're hashing constant-size types (even more so if they're a multiple of 32 bits in size), the code will be significantly faster than the original implementation.

Definition at line 55 of file murmur3.hpp.


Member Function Documentation

static uint32_t moost::hash::murmur3::compute32 ( const void *  key,
size_t  len,
uint32_t  seed 
) [inline, static]

Definition at line 80 of file murmur3.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
static uint32_t moost::hash::murmur3::compute32 ( const T &  key,
uint32_t  seed 
) [inline, static]

Definition at line 132 of file murmur3.hpp.

Here is the call graph for this function:

static uint32_t moost::hash::murmur3::compute32 ( const std::string &  key,
uint32_t  seed 
) [inline, static]

Definition at line 138 of file murmur3.hpp.

Here is the call graph for this function:

template<typename T >
static uint32_t moost::hash::murmur3::compute32 ( const std::vector< T > &  key,
uint32_t  seed 
) [inline, static]

Definition at line 144 of file murmur3.hpp.

Here is the call graph for this function:

static uint32_t moost::hash::murmur3::fmix ( uint32_t  h) [inline, static, private]

Definition at line 58 of file murmur3.hpp.

Here is the caller graph for this function:

static uint32_t moost::hash::murmur3::getblock ( const uint32_t *  p,
int  i 
) [inline, static, private]

Definition at line 69 of file murmur3.hpp.

Here is the caller graph for this function:

static uint32_t moost::hash::murmur3::rotl32 ( uint32_t  x,
int8_t  r 
) [inline, static, private]

Definition at line 74 of file murmur3.hpp.

Here is the caller graph for this function:


The documentation for this class was generated from the following file: