17constexpr static uint64_t rotl64(uint64_t x,
int r)
19 return (x << r) | (x >> (64 - r));
29void Hasher::add_block(uint64_t k1, uint64_t k2)
31 constexpr uint64_t c1 = 0x87c37b91114253d5ull;
32 constexpr uint64_t c2 = 0x4cf5ad432745937full;
41 data[0] =
data[0] * 5 + 0x52dce729ull;
50 data[1] =
data[1] * 5 + 0x38495ab5ull;
53static uint64_t fmix64(uint64_t k)
58 k *= 0xbf58476d1ce4e5b9ull;
60 k *= 0x94d049bb133111ebull;
71 auto rem = nbytes % 16;
73 std::byte *tmp =
reinterpret_cast<std::byte *
>(buf_);
76 if (bytes + rem >= 16)
78 std::copy(vs, vs + 16 - rem, tmp + rem);
79 add_block(buf_[0], buf_[1]);
86 std::copy(vs, vs + bytes, tmp + rem);
94 auto rem = nbytes % 16;
123 constexpr uint64_t c1 = 0x87c37b91114253d5ull;
124 constexpr uint64_t c2 = 0x4cf5ad432745937full;
146 constexpr uint64_t c1 = 0x87c37b91114253d5ull;
147 constexpr uint64_t c2 = 0x4cf5ad432745937full;
void init(uint64_t seed=0)
Resets the Hasher back to an initial seed.
uint64_t data[2]
Storage for the final hash result after finalize() is called.
void append(const std::byte *vs, uint64_t bytes)
Append data vs of size bytes.