<commit_before>// Copyright 2015-2019 <NAME>. All rights reserved.

#ifndef OUZEL_MATH_FNV_HPP
#define OUZEL_MATH_FNV_HPP

#include <cstdint>

namespace ouzel
{
    namespace fnv
    {
        template <typename T> constexpr T prime;
        template <typename T> constexpr T offsetBasis;

        template <> constexpr uint32_t prime<uint32_t> = 16777619u;
        template <> constexpr uint32_t offsetBasis<uint32_t> = 2166136261u;
        template <> constexpr uint64_t prime<uint64_t> = 1099511628211u;
        template <> constexpr uint64_t offsetBasis<uint64_t> = 14695981039346656037u;

        // Fowler / Noll / Vo (FNV) hash
        template <typename Result, typename Value>
        constexpr Result hash(const Value value, size_t i = 0, Result result = offsetBasis<Result>) noexcept
        {
            return (i < sizeof(Value)) ? hash<Result>(value, i + 1, (result * prime<Result>) ^ ((value >> (i * 8)) & 0xFF)) : result;
        }
    } // namespace fnv
} // namespace ouzel

#endif // OUZEL_MATH_FNV_HPP
<commit_msg>Add FNV constants to inline namespace<commit_after>// Copyright 2015-2019 <NAME>. All rights reserved.

#ifndef OUZEL_MATH_FNV_HPP
#define OUZEL_MATH_FNV_HPP

#include <cstdint>

namespace ouzel
{
    namespace fnv
    {
        inline namespace detail
        {
            template <typename T> constexpr T prime;
            template <typename T> constexpr T offsetBasis;

            template <> constexpr uint32_t prime<uint32_t> = 16777619u;
            template <> constexpr uint32_t offsetBasis<uint32_t> = 2166136261u;
            template <> constexpr uint64_t prime<uint64_t> = 1099511628211u;
            template <> constexpr uint64_t offsetBasis<uint64_t> = 14695981039346656037u;
        }

        // Fowler / Noll / Vo (FNV) hash
        template <typename Result, typename Value>
        constexpr Result hash(const Value value, size_t i = 0, Result result = offsetBasis<Result>) noexcept
        {
            return (i < sizeof(Value)) ? hash<Result>(value, i + 1, (result * prime<Result>) ^ ((value >> (i * 8)) & 0xFF)) : result;
        }
    } // namespace fnv
} // namespace ouzel

#endif // OUZEL_MATH_FNV_HPP

{'fraction_non_alphanumeric': 0.09861751152073733, 'fraction_numerical': 0.0728110599078341, 'mean_word_length': 2.8289241622574957, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '465099', 'n_tokens_mistral': 828, 'n_tokens_neox': 691, 'n_words': 188}