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

#ifndef OUZEL_HASH_FNV1_HPP
#define OUZEL_HASH_FNV1_HPP

#include <cstdint>

namespace ouzel::hash::fnv1
{
    inline namespace detail
    {
        template <typename T> T prime();
        template <typename T> T offsetBasis();

        template <> constexpr std::uint32_t prime<std::uint32_t>() { return 16777619U; }
        template <> constexpr std::uint32_t offsetBasis<std::uint32_t>() { return 2166136261U; }
        template <> constexpr std::uint64_t prime<std::uint64_t>() { return 1099511628211ULL; }
        template <> constexpr std::uint64_t offsetBasis<std::uint64_t>() { return 14695981039346656037ULL; }
    }

    // Fowler / Noll / Vo (FNV) hash
    template <typename Result, typename Value>
    constexpr Result hash(const Value value, std::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;
    }
}

#endif // OUZEL_HASH_FNV1_HPP<commit_msg>Use const for all parameters of hash<commit_after>// Copyright 2015-2020 <NAME>. All rights reserved.

#ifndef OUZEL_HASH_FNV1_HPP
#define OUZEL_HASH_FNV1_HPP

#include <cstdint>

namespace ouzel::hash::fnv1
{
    inline namespace detail
    {
        template <typename T> T prime();
        template <typename T> T offsetBasis();

        template <> constexpr std::uint32_t prime<std::uint32_t>() { return 16777619U; }
        template <> constexpr std::uint32_t offsetBasis<std::uint32_t>() { return 2166136261U; }
        template <> constexpr std::uint64_t prime<std::uint64_t>() { return 1099511628211ULL; }
        template <> constexpr std::uint64_t offsetBasis<std::uint64_t>() { return 14695981039346656037ULL; }
    }

    template <typename Result, typename Value>
    constexpr Result hash(const Value value, const std::size_t i = 0,
                          const Result result = offsetBasis<Result>()) noexcept
    {
        return (i < sizeof(Value)) ? hash<Result>(value, i + 1, (result * prime<Result>()) ^ ((value >> (i * 8)) & 0xFF)) : result;
    }
}

#endif // OUZEL_HASH_FNV1_HPP
{'fraction_non_alphanumeric': 0.12912087912087913, 'fraction_numerical': 0.076007326007326, 'mean_word_length': 3.6390658174097665, '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': '5653217', 'n_tokens_mistral': 854, 'n_tokens_neox': 721, 'n_words': 180}