50 const auto* bytes =
static_cast<const unsigned char*
>(data);
52 std::size_t hash = 14695981039346656037ull;
53 for (std::size_t i = 0; i < size; ++i)
56 hash *= 1099511628211ull;
87 inline void hash_combine(std::size_t& seed, std::size_t value)
noexcept
89 seed ^= value + 0x9e3779b97f4a7c15 + (seed << 6) + (seed >> 2);
109 static_assert(std::is_integral_v<T>,
"hash_int requires an integral type");
122 std::size_t hash = 14695981039346656037ull;
123 hash ^=
static_cast<unsigned char>(c);
124 hash *= 1099511628211ull;
144 static_assert(std::is_floating_point_v<T>,
"hash_float requires a floating point type");
146 if (value == T(0)) value = T(0);
std::size_t fnv1a_hash_bytes(const void *data, std::size_t size) noexcept
Hash utilities for OpenMS classes.
Definition HashUtils.h:48
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::size_t hash_int(T value) noexcept
Hash for an integer type.
Definition HashUtils.h:107
void hash_combine(std::size_t &seed, std::size_t value) noexcept
Combine a hash value with additional data using golden ratio mixing.
Definition HashUtils.h:87
std::size_t hash_char(char c) noexcept
Hash for a character.
Definition HashUtils.h:119
std::size_t hash_float(T value) noexcept
Hash for a floating point type (float or double).
Definition HashUtils.h:142
std::size_t fnv1a_hash_string(const std::string &s) noexcept
FNV-1a hash for a string.
Definition HashUtils.h:70