Embedded Template Library 1.0
Murmur3 hash calculations

Classes

class  etl::murmur3< THash >
 

Detailed Description


Class Documentation

◆ etl::murmur3

class etl::murmur3
template<typename THash>
class etl::murmur3< THash >

Calculates the murmur3 hash. See https://en.wikipedia.org/wiki/MurmurHash for more details.

Public Types

typedef THash value_type
 

Public Member Functions

 ETL_STATIC_ASSERT ((etl::is_same< THash, uint32_t >::value||etl::is_same< THash, uint64_t >::value), "Only 32 & 64 bit types supported")
 
 murmur3 (value_type seed_=0)
 
template<typename TIterator >
 murmur3 (TIterator begin, const TIterator end, value_type seed_=0)
 
void reset ()
 Resets the hash to the initial state.
 
template<typename TIterator >
void add (TIterator begin, const TIterator end)
 
void add (uint8_t value_)
 
value_type value ()
 Gets the hash value.
 
 operator value_type ()
 Conversion operator to value_type.
 

Constructor & Destructor Documentation

◆ murmur3() [1/2]

template<typename THash >
etl::murmur3< THash >::murmur3 ( value_type  seed_ = 0)
inline

Default constructor.

Parameters
seedThe seed value. Default = 0.

◆ murmur3() [2/2]

template<typename THash >
template<typename TIterator >
etl::murmur3< THash >::murmur3 ( TIterator  begin,
const TIterator  end,
value_type  seed_ = 0 
)
inline

Constructor from range.

Parameters
beginStart of the range.
endEnd of the range.
seedThe seed value. Default = 0.

Member Function Documentation

◆ add() [1/2]

template<typename THash >
template<typename TIterator >
void etl::murmur3< THash >::add ( TIterator  begin,
const TIterator  end 
)
inline

Adds a range.

Parameters
begin
end

◆ add() [2/2]

template<typename THash >
void etl::murmur3< THash >::add ( uint8_t  value_)
inline

Adds a uint8_t value. If the hash has already been finalised then a 'hash_finalised' error will be emitted.

Parameters
valueThe char to add to the hash.