| 1 |
#ifndef AWS_CHECKSUMS_XXHASH_H |
| 2 |
#define AWS_CHECKSUMS_XXHASH_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#include <aws/checksums/exports.h> |
| 9 |
#include <aws/common/byte_buf.h> |
| 10 |
|
| 11 |
AWS_PUSH_SANE_WARNING_LEVEL |
| 12 |
|
| 13 |
struct aws_xxhash_impl; |
| 14 |
|
| 15 |
enum aws_xxhash_type { XXHASH64 = 0, XXHASH3_64 = 1, XXHASH3_128 = 2 }; |
| 16 |
|
| 17 |
struct aws_xxhash { |
| 18 |
struct aws_allocator *allocator; |
| 19 |
enum aws_xxhash_type type; |
| 20 |
struct aws_xxhash_impl *impl; |
| 21 |
}; |
| 22 |
|
| 23 |
AWS_EXTERN_C_BEGIN |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
AWS_CHECKSUMS_API struct aws_xxhash *aws_xxhash64_new(struct aws_allocator *allocator, uint64_t seed); |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
AWS_CHECKSUMS_API struct aws_xxhash *aws_xxhash3_64_new(struct aws_allocator *allocator, uint64_t seed); |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
AWS_CHECKSUMS_API struct aws_xxhash *aws_xxhash3_128_new(struct aws_allocator *allocator, uint64_t seed); |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
AWS_CHECKSUMS_API int aws_xxhash_update(struct aws_xxhash *hash, struct aws_byte_cursor data); |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
AWS_CHECKSUMS_API int aws_xxhash_finalize(struct aws_xxhash *hash, struct aws_byte_buf *out); |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
AWS_CHECKSUMS_API void aws_xxhash_destroy(struct aws_xxhash *hash); |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
AWS_CHECKSUMS_API int aws_xxhash64_compute(uint64_t seed, struct aws_byte_cursor data, struct aws_byte_buf *out); |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
AWS_CHECKSUMS_API int aws_xxhash3_64_compute(uint64_t seed, struct aws_byte_cursor data, struct aws_byte_buf *out); |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
AWS_CHECKSUMS_API int aws_xxhash3_128_compute(uint64_t seed, struct aws_byte_cursor data, struct aws_byte_buf *out); |
| 83 |
|
| 84 |
AWS_EXTERN_C_END |
| 85 |
AWS_POP_SANE_WARNING_LEVEL |
| 86 |
|
| 87 |
#endif |