blob: 752c35975f679df5fa3ec96db6bd1dc8385af183 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#pragma once
namespace floormat::Hash {
template<size_t N = sizeof nullptr * 4> struct fnvhash_params;
template<> struct fnvhash_params<32> { static constexpr uint32_t a = 0x811c9dc5u, b = 0x01000193u; };
template<> struct fnvhash_params<64> { static constexpr uint64_t a = 0xcbf29ce484222325u, b = 0x100000001b3u; };
size_t fnvhash_buf(const void* __restrict buf, size_t size, size_t seed = fnvhash_params<>::a) noexcept;
} // namespace floormat::Hash
namespace floormat { // todo
uint64_t hash_64(const void* buf, size_t size) noexcept;
uint32_t hash_32(const void* buf, size_t size) noexcept;
size_t hash_int(uint32_t x) noexcept;
size_t hash_int(uint64_t x) noexcept;
} // namespace floormat
|