31#ifndef ETL_MURMUR3_INCLUDED
32#define ETL_MURMUR3_INCLUDED
42#if defined(ETL_COMPILER_KEIL)
43#pragma diag_suppress 1300
56 template <
typename THash>
61#if ETL_NOT_USING_64BIT_TYPES
67 typedef THash value_type;
85 template<
typename TIterator>
89 ETL_STATIC_ASSERT(
sizeof(
typename etl::iterator_traits<TIterator>::value_type) == 1,
"Incompatible type");
94 block |= (*begin) << (block_fill_count * 8U);
97 if (++block_fill_count == FULL_BLOCK)
100 block_fill_count = 0;
116 block_fill_count = 0;
117 is_finalised =
false;
125 template<
typename TIterator>
128 ETL_STATIC_ASSERT(
sizeof(
typename etl::iterator_traits<TIterator>::value_type) == 1,
"Incompatible type");
133 block |= (*begin) << (block_fill_count * 8U);
136 if (++block_fill_count == FULL_BLOCK)
139 block_fill_count = 0;
157 block |= value_ << (block_fill_count * 8U);
159 if (++block_fill_count == FULL_BLOCK)
162 block_fill_count = 0;
181 operator value_type ()
199 hash = (hash * MULTIPLY) + ADD;
215 hash ^= (hash >> 16U);
216 hash *= 0x85EBCA6BUL;
217 hash ^= (hash >> 13U);
218 hash *= 0xC2B2AE35UL;
219 hash ^= (hash >> 16U);
226 uint8_t block_fill_count;
232 static ETL_CONSTANT uint8_t FULL_BLOCK = 4U;
233 static ETL_CONSTANT value_type CONSTANT1 = 0xCC9E2D51UL;
234 static ETL_CONSTANT value_type CONSTANT2 = 0x1B873593UL;
235 static ETL_CONSTANT value_type SHIFT1 = 15;
236 static ETL_CONSTANT value_type SHIFT2 = 13;
237 static ETL_CONSTANT value_type MULTIPLY = 5;
238 static ETL_CONSTANT value_type ADD = 0xE6546B64UL;
ETL_CONSTEXPR14 T rotate_left(T value)
Definition binary.h:117
#define ETL_ASSERT(b, e)
Definition error_handler.h:356
void reset()
Resets the hash to the initial state.
Definition murmur3.h:111
murmur3(value_type seed_=0)
Definition murmur3.h:73
murmur3(TIterator begin, const TIterator end, value_type seed_=0)
Definition murmur3.h:86
void add(TIterator begin, const TIterator end)
Definition murmur3.h:126
value_type value()
Gets the hash value.
Definition murmur3.h:172
void add(uint8_t value_)
Definition murmur3.h:152
is_same
Definition type_traits_generator.h:1104
bitset_ext
Definition absolute.h:39
ETL_CONSTEXPR TContainer::iterator begin(TContainer &container)
Definition iterator.h:962
ETL_CONSTEXPR TContainer::iterator end(TContainer &container)
Definition iterator.h:992