6 #ifndef TURI_HASH_VALUE_H_ 7 #define TURI_HASH_VALUE_H_ 9 #include <core/util/cityhash_tc.hpp> 10 #include <core/util/bitops.hpp> 11 #include <core/storage/serialization/serialization_includes.hpp> 33 template <
typename... Args>
52 uint128_t
hash()
const {
return h_128; }
59 uint64_t v = (h_2_64.first * 0x7e952a7b972f486fULL) ^ (h_2_64.second * 0xdeb2a42e44aa4c17ULL);
60 return v >> (bitsizeof(uint64_t) - n_bits);
65 void load(
iarchive &iarc) { iarc >> h_128; }
70 std::pair<uint64_t, uint64_t> h_2_64;
79 #pragma clang diagnostic push 80 #pragma clang diagnostic ignored "-Wmismatched-tags" 85 return size_t(t.
hash());
90 #pragma clang diagnostic pop
static uint128_t hash128(const char *s, size_t len)
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
hash_value(uint128_t h)
Explicit constructor from a hash value output.
size_t n_bit_index(size_t n_bits) const
Returns the top number of bits in the hash.
hash_value(Args... args)
Redirect to the appropriate hash function.
Inheriting from this type will force the serializer to treat the derived type as a POD type...
hash_value(const hash_value &t)
Copy constructor.
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
void save(oarchive &oarc) const
Serialization.
uint128_t hash() const
Returns the 128 bit hash value of the token.