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 * 8);
95 if (++block_fill_count == FULL_BLOCK)
114 block_fill_count = 0;
115 is_finalised =
false;
123 template<
typename TIterator>
126 ETL_STATIC_ASSERT(
sizeof(
typename etl::iterator_traits<TIterator>::value_type) == 1,
"Incompatible type");
131 block |= (*
begin++) << (block_fill_count * 8);
133 if (++block_fill_count == FULL_BLOCK)
136 block_fill_count = 0;
154 block |= value_ << (block_fill_count * 8);
156 if (++block_fill_count == FULL_BLOCK)
159 block_fill_count = 0;
178 operator value_type ()
212 hash ^= (hash >> 16);
214 hash ^= (hash >> 13);
216 hash ^= (hash >> 16);
223 uint8_t block_fill_count;
229 static const uint8_t FULL_BLOCK = 4;
230 static const value_type CONSTANT1 = 0xCC9E2D51;
231 static const value_type CONSTANT2 = 0x1B873593;
232 static const value_type SHIFT1 = 15;
233 static const value_type SHIFT2 = 13;
234 static const value_type MULTIPLY = 5;
235 static const value_type ADD = 0xE6546B64;
ETL_CONSTEXPR14 T rotate_left(T value)
Definition: binary.h:115
ETL_CONSTEXPR TContainer::iterator begin(TContainer &container)
Definition: container.h:49
ETL_CONSTEXPR TContainer::iterator end(TContainer &container)
Definition: container.h:99
#define ETL_ASSERT(b, e)
Definition: error_handler.h:290
void reset()
Resets the hash to the initial state.
Definition: murmur3.h:109
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:124
value_type value()
Gets the hash value.
Definition: murmur3.h:169
void add(uint8_t value_)
Definition: murmur3.h:149
is_same
Definition: type_traits_generator.h:981
Definition: absolute.h:37