libboxes
boxes is a set of specialised containers built on top of STL
hashes.hpp
Go to the documentation of this file.
1
9#ifndef __BOXES_HASHES_HPP__
10#define __BOXES_HASHES_HPP__
11
12#include <xxhash.h>
13
14#include <memory>
15
16namespace boxes::hash {
17
27class XXHash64 {
28public:
29 explicit XXHash64(uint64_t seed = 0);
30
31 void reset();
32
33 void operator()(const uint8_t *key, std::size_t len);
34
35 uint64_t final() const;
36
37protected:
38 uint64_t seed;
39 std::unique_ptr<XXH64_state_t, decltype(&XXH64_freeState)> state;
40};
41
52public:
53 explicit Murmur2A_X64_64(uint64_t seed);
54
55 void reset();
56
57 void operator()(const uint8_t *key, std::size_t len);
58
59 uint64_t final() const;
60
61protected:
62 uint64_t seed;
63 uint64_t h;
64};
65
78public:
79 explicit BJOneAtATime(uint64_t seed);
80
81 void reset();
82
83 void operator()(const uint8_t *key, std::size_t length);
84
85 uint64_t final() const;
86
87protected:
88 uint32_t hash;
89 uint32_t seed;
90};
91
92} // namespace boxes::hash
93
94#endif // __BOXES_HASHES_HPP__
a boxes wrapper for Bob Jenkins' One-at-a-Time algorithm
Definition: hashes.hpp:77
a boxes wrapper for the Murmur2A algorithm
Definition: hashes.hpp:51
boxes wrapper for the xxhash64 algorithm
Definition: hashes.hpp:27