7#include "TTauri/Foundation/required.hpp"
8#include "TTauri/Foundation/type_traits.hpp"
16[[nodiscard]]
inline size_t hash_mix_two(
size_t hash1,
size_t hash2)
noexcept
18 ttlet
round = _mm_set_epi64x(0x123456789abcdef0ULL, 0x0fedcba987654321ULL);
20 auto hash = _mm_set_epi64x(hash1, hash2);
21 hash = _mm_aesenc_si128(hash, round);
22 hash = _mm_aesenc_si128(hash, round);
25 _mm_storeu_si64(buffer.
data(), hash);
29template<
typename First,
typename Second,
typename... Args>
30[[nodiscard]]
size_t hash_mix(First &&first, Second &&second, Args &&... args)
noexcept {
31 if constexpr (
sizeof...(args) == 0) {
33 std::hash<remove_cvref_t<First>>{}(std::forward<First>(first)),
34 std::hash<remove_cvref_t<Second>>{}(std::forward<Second>(second))
38 std::hash<remove_cvref_t<First>>{}(std::forward<First>(first)),
39 hash_mix(std::forward<Second>(second), std::forward<Args>(args)...)