diff --git a/src/hash.h b/src/hash.h index 1802d311..3d02ab9b 100644 --- a/src/hash.h +++ b/src/hash.h @@ -45,8 +45,22 @@ namespace etl { namespace __private_hash__ { + //************************************************************************* + /// Hash to use when size_t is 16 bits. + /// T is always expected to be size_t. + //************************************************************************* + template + typename enable_if::type + generic_hash(uint8_t* begin, uint8_t* end) + { + uint32_t h = fnv_1a_32(begin, end); + + return static_cast(h ^ (h >> 16)); + } + //************************************************************************* /// Hash to use when size_t is 32 bits. + /// T is always expected to be size_t. //************************************************************************* template typename enable_if::type @@ -57,6 +71,7 @@ namespace etl //************************************************************************* /// Hash to use when size_t is 64 bits. + /// T is always expected to be size_t. //************************************************************************* template typename enable_if::type