Antkeeper  0.0.1
Classes | Namespaces | Functions
fnv1a.hpp File Reference
#include <concepts>
#include <cstdint>
#include <string_view>
#include <utility>
#include <span>

Go to the source code of this file.

Classes

struct  hash::types::fnv1a32_t
 32-bit FNV-1a hash value. More...
 
struct  hash::types::fnv1a64_t
 64-bit FNV-1a hash value. More...
 
struct  std::hash<::hash::fnv1a32_t >
 
struct  std::hash<::hash::fnv1a64_t >
 

Namespaces

 hash
 Hash functions.
 
 hash::types
 Distinct hash value types for different hash algorithms.
 
 hash::literals
 User-defined literals for compile-time string hashing.
 

Functions

template<std::unsigned_integral HashT, std::integral DataT>
constexpr HashT hash::fnv1a (std::span< const DataT > data, HashT offset, HashT prime) noexcept
 FNV-1a hash function. More...
 
template<std::integral DataT>
constexpr std::uint32_t hash::fnv1a32 (std::span< const DataT > data) noexcept
 32-bit FNV-1a hash function. More...
 
template<std::integral DataT>
constexpr std::uint64_t hash::fnv1a64 (std::span< const DataT > data) noexcept
 64-bit FNV-1a hash function. More...
 
consteval std::uint32_t hash::literals::operator""_fnv1a32 (const char *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 32-bit FNV-1a hash function. More...
 
consteval std::uint32_t hash::literals::operator""_fnv1a32 (const wchar_t *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 32-bit FNV-1a hash function. More...
 
consteval std::uint32_t hash::literals::operator""_fnv1a32 (const char8_t *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 32-bit FNV-1a hash function. More...
 
consteval std::uint32_t hash::literals::operator""_fnv1a32 (const char16_t *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 32-bit FNV-1a hash function. More...
 
consteval std::uint32_t hash::literals::operator""_fnv1a32 (const char32_t *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 32-bit FNV-1a hash function. More...
 
consteval std::uint64_t hash::literals::operator""_fnv1a64 (const char *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 64-bit FNV-1a hash function. More...
 
consteval std::uint64_t hash::literals::operator""_fnv1a64 (const wchar_t *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 64-bit FNV-1a hash function. More...
 
consteval std::uint64_t hash::literals::operator""_fnv1a64 (const char8_t *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 64-bit FNV-1a hash function. More...
 
consteval std::uint64_t hash::literals::operator""_fnv1a64 (const char16_t *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 64-bit FNV-1a hash function. More...
 
consteval std::uint64_t hash::literals::operator""_fnv1a64 (const char32_t *string, std::size_t length) noexcept
 Hashes a string at compile-time using the 64-bit FNV-1a hash function. More...
 
constexpr bool operator== (const ::hash::fnv1a32_t &lhs, const ::hash::fnv1a32_t &rhs) noexcept
 Compares two FNV-1a hash values for equality. More...
 
constexpr bool operator== (const ::hash::fnv1a64_t &lhs, const ::hash::fnv1a64_t &rhs) noexcept
 Compares two FNV-1a hash values for equality. More...
 
constexpr bool operator< (const ::hash::fnv1a32_t &lhs, const ::hash::fnv1a32_t &rhs) noexcept
 Checks if one FNV-1a hash value is less than another. More...
 
constexpr bool operator< (const ::hash::fnv1a64_t &lhs, const ::hash::fnv1a64_t &rhs) noexcept
 Checks if one FNV-1a hash value is less than another. More...
 

Function Documentation

◆ operator<() [1/2]

constexpr bool operator< ( const ::hash::fnv1a32_t lhs,
const ::hash::fnv1a32_t rhs 
)
inlineconstexprnoexcept

Checks if one FNV-1a hash value is less than another.

Definition at line 329 of file fnv1a.hpp.

◆ operator<() [2/2]

constexpr bool operator< ( const ::hash::fnv1a64_t lhs,
const ::hash::fnv1a64_t rhs 
)
inlineconstexprnoexcept

Checks if one FNV-1a hash value is less than another.

Definition at line 333 of file fnv1a.hpp.

◆ operator==() [1/2]

constexpr bool operator== ( const ::hash::fnv1a32_t lhs,
const ::hash::fnv1a32_t rhs 
)
inlineconstexprnoexcept

Compares two FNV-1a hash values for equality.

Definition at line 315 of file fnv1a.hpp.

◆ operator==() [2/2]

constexpr bool operator== ( const ::hash::fnv1a64_t lhs,
const ::hash::fnv1a64_t rhs 
)
inlineconstexprnoexcept

Compares two FNV-1a hash values for equality.

Definition at line 319 of file fnv1a.hpp.