/src/dovecot/src/lib/xxh64.h
Line | Count | Source |
1 | | #ifndef XXH64_H |
2 | | #define XXH64_H |
3 | | |
4 | | #include "hash-method.h" |
5 | | |
6 | | #define XXH64_RESULTLEN 8 |
7 | | |
8 | | struct xxh64_context { |
9 | | uint64_t seed; |
10 | | uint64_t v1, v2, v3, v4; |
11 | | uint64_t total_len; |
12 | | unsigned char buf[32]; |
13 | | unsigned int buf_used; |
14 | | }; |
15 | | |
16 | | void xxh64_init(struct xxh64_context *ctx, uint64_t seed); |
17 | | void xxh64_loop(struct xxh64_context *ctx, const void *data, size_t size); |
18 | | uint64_t xxh64_result(struct xxh64_context *ctx); |
19 | | |
20 | | uint64_t xxh64_data(const void *data, size_t size, uint64_t seed) ATTR_PURE; |
21 | | |
22 | | /* XOR-fold the 64-bit hash to 32 bits */ |
23 | | static inline uint32_t xxh64_to_32(uint64_t hash) |
24 | 0 | { |
25 | 0 | return (uint32_t)(hash ^ (hash >> 32)); |
26 | 0 | } Unexecuted instantiation: hash.c:xxh64_to_32 Unexecuted instantiation: hash-method.c:xxh64_to_32 Unexecuted instantiation: xxh64.c:xxh64_to_32 |
27 | | |
28 | | extern const struct hash_method hash_method_xxh64; |
29 | | |
30 | | #endif |