Corrade::Utility::MurmurHash2 class

MurmurHash 2.

Based on algorithm copyright Austin Appleby, http://code.google.com/p/smhasher/ . The digest is 32bit or 64bit, depending on sizeof(std::size_t) and thus usable for hashing in e.g. std::unordered_map.

Base classes

template<std::size_t digestSize>
class AbstractHash<sizeof(std::size_t)>
Base template for hashing classes.

Public static functions

static auto digest(const std::string& data) -> Digest
Digest of given data.

Constructors, destructors, conversion operators

MurmurHash2(std::size_t seed = 0) explicit constexpr
Constructor.

Public functions

auto operator()(const std::string& data) const -> Digest
Compute digest of given data.
template<std::size_t size>
auto operator()(const char(&data)[size]) const -> Digest
Compute digest of given data.
auto operator()(const char* data, std::size_t size) const -> Digest
Compute digest of given data.

Function documentation

static Digest Corrade::Utility::MurmurHash2::digest(const std::string& data)

Digest of given data.

Computes digest using default zero seed. This function is here for consistency with other AbstractHash subclasses.

Corrade::Utility::MurmurHash2::MurmurHash2(std::size_t seed = 0) explicit constexpr

Constructor.

Parameters
seed Seed to initialize the hash