15 std::uint64_t
hash = 0xcbf29ce484222325ull;
16 for (
const char c :
str) {
17 hash ^=
static_cast<unsigned char>(
c);
18 hash *= 0x100000001b3ull;
28 [[
nodiscard]]
consteval std::uint64_t
operator""_hash(
const char*
str, std::size_t size)
noexcept
30 return hash(std::string_view(
str, size));
String helpers: case, trimming, splitting, joining, replacing, parsing and hashing.
Definition Char.hpp:3
constexpr std::uint64_t hash(std::string_view str) noexcept
64-bit FNV-1a hash, usable at compile time.
Definition Hash.hpp:13
std::optional< T > parseNumber(std::string_view text, int base=10) noexcept
Parses text as a number, or returns std::nullopt if it is not entirely one.
Definition Convert.hpp:23