18 for (
const uint8 *data =
reinterpret_cast<const uint8 *
>(inData); data < reinterpret_cast<const uint8 *>(inData) + inSize; ++data)
20 hash = hash ^
uint64(*data);
21 hash = hash * 0x100000001b3UL;
33 hash = (~hash) + (hash << 21);
34 hash = hash ^ (hash >> 24);
35 hash = (hash + (hash << 3)) + (hash << 8);
36 hash = hash ^ (hash >> 14);
37 hash = (hash + (hash << 2)) + (hash << 4);
38 hash = hash ^ (hash >> 28);
39 hash = hash + (hash << 31);
49 ioSeed ^= hasher(inValue) + 0x9e3779b9 + (ioSeed << 6) + (ioSeed >> 2);
64template <
typename... Values>
65inline void HashCombine(std::size_t &ioSeed, Values... inValues)
73JPH_SUPPRESS_WARNING_PUSH
76#define JPH_MAKE_HASH_STRUCT(type, name, ...) \
77 struct [[nodiscard]] name \
79 std::size_t operator()(const type &t) const \
81 std::size_t ret = 0; \
82 ::JPH::HashCombine(ret, __VA_ARGS__); \
87#define JPH_MAKE_HASHABLE(type, ...) \
88 JPH_SUPPRESS_WARNING_PUSH \
89 JPH_SUPPRESS_WARNINGS \
93 JPH_MAKE_HASH_STRUCT(type, hash<type>, __VA_ARGS__) \
95 JPH_SUPPRESS_WARNING_POP
97JPH_SUPPRESS_WARNING_POP
std::uint8_t uint8
Definition: Core.h:440
std::uint64_t uint64
Definition: Core.h:443
unsigned int uint
Definition: Core.h:439
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_CLANG_SUPPRESS_WARNING(w)
Definition: Core.h:254
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
JPH_NAMESPACE_BEGIN uint64 HashBytes(const void *inData, uint inSize, uint64 inSeed=0xcbf29ce484222325UL)
Definition: HashCombine.h:15
void HashCombine(std::size_t &ioSeed, Values... inValues)
Definition: HashCombine.h:65
void HashCombineHelper(size_t &ioSeed, const T &inValue)
Helper function that hashes a single value into ioSeed Taken from: https://stackoverflow....
Definition: HashCombine.h:46
uint64 Hash64(uint64 inValue)
Definition: HashCombine.h:30