sandbox
Loading...
Searching...
No Matches
sbx::utility::fnv1a_hash< Char, Hash, HashTraits > Struct Template Reference

Functor that implements the fnv1a hash algorithm. More...

#include <hash.hpp>

Public Types

using char_type = Char
 
using size_type = std::size_t
 
using hash_type = Hash
 
using hash_traits = HashTraits
 

Public Member Functions

constexpr auto operator() (std::basic_string_view< Char > string) const noexcept -> hash_type
 Hashes the given string. More...
 

Detailed Description

template<character Char, std::unsigned_integral Hash = std::uint64_t, typename HashTraits = fnv1a_traits<Hash>>
struct sbx::utility::fnv1a_hash< Char, Hash, HashTraits >

Functor that implements the fnv1a hash algorithm.

Template Parameters
CharThe character type of the string to hash.
HashThe type of the hash. Defaults to std::uint64_t.
HashTraitsThe traits of the hash. Defaults to fnv1a_traits<Hash>.

Member Function Documentation

◆ operator()()

template<character Char, std::unsigned_integral Hash = std::uint64_t, typename HashTraits = fnv1a_traits<Hash>>
constexpr auto sbx::utility::fnv1a_hash< Char, Hash, HashTraits >::operator() ( std::basic_string_view< Char >  string) const -> hash_type
inlineconstexprnoexcept

Hashes the given string.

Parameters
stringThe string to hash.
sizeThe size of the string.
Returns
hash_type The hash of the string.

The documentation for this struct was generated from the following file: