31#ifndef ETL_MURMUR3_INCLUDED
32#define ETL_MURMUR3_INCLUDED
41#if defined(ETL_COMPILER_KEIL)
42#pragma diag_suppress 1300
55 template <
typename THash>
60#if ETL_NOT_USING_64BIT_TYPES
66 typedef THash value_type;
84 template<
typename TIterator>
88 ETL_STATIC_ASSERT(
sizeof(
typename etl::iterator_traits<TIterator>::value_type) == 1,
"Incompatible type");
93 block |= (*begin) << (block_fill_count * 8U);
96 if (++block_fill_count == FULL_BLOCK)
115 block_fill_count = 0;
116 is_finalised =
false;
124 template<
typename TIterator>
127 ETL_STATIC_ASSERT(
sizeof(
typename etl::iterator_traits<TIterator>::value_type) == 1,
"Incompatible type");
132 block |= (*begin) << (block_fill_count * 8U);
135 if (++block_fill_count == FULL_BLOCK)
138 block_fill_count = 0;
156 block |= value_ << (block_fill_count * 8U);
158 if (++block_fill_count == FULL_BLOCK)
161 block_fill_count = 0;
180 operator value_type ()
198 hash = (hash * MULTIPLY) + ADD;
214 hash ^= (hash >> 16U);
215 hash *= 0x85EBCA6BUL;
216 hash ^= (hash >> 13U);
217 hash *= 0xC2B2AE35UL;
218 hash ^= (hash >> 16U);
225 uint8_t block_fill_count;
231 static ETL_CONSTANT uint8_t FULL_BLOCK = 4U;
232 static ETL_CONSTANT value_type CONSTANT1 = 0xCC9E2D51UL;
233 static ETL_CONSTANT value_type CONSTANT2 = 0x1B873593UL;
234 static ETL_CONSTANT value_type SHIFT1 = 15;
235 static ETL_CONSTANT value_type SHIFT2 = 13;
236 static ETL_CONSTANT value_type MULTIPLY = 5;
237 static ETL_CONSTANT value_type ADD = 0xE6546B64UL;
ETL_CONSTEXPR14 T rotate_left(T value)
Definition: binary.h:116
#define ETL_ASSERT(b, e)
Definition: error_handler.h:316
void reset()
Resets the hash to the initial state.
Definition: murmur3.h:110
murmur3(value_type seed_=0)
Definition: murmur3.h:72
murmur3(TIterator begin, const TIterator end, value_type seed_=0)
Definition: murmur3.h:85
void add(TIterator begin, const TIterator end)
Definition: murmur3.h:125
value_type value()
Gets the hash value.
Definition: murmur3.h:171
void add(uint8_t value_)
Definition: murmur3.h:151
is_same
Definition: type_traits_generator.h:1041
bitset_ext
Definition: absolute.h:38
ETL_CONSTEXPR TContainer::iterator begin(TContainer &container)
Definition: iterator.h:931
ETL_CONSTEXPR TContainer::iterator end(TContainer &container)
Definition: iterator.h:961