Added XXHash3

This commit is contained in:
korenkonder
2024-04-29 14:16:15 +03:00
parent 466104e3c5
commit e0e7bf7033
10 changed files with 7301 additions and 120 deletions
+7
View File
@@ -4,6 +4,9 @@
*/
#include "hash.hpp"
#define XXH_STATIC_LINKING_ONLY
#define XXH_IMPLEMENTATION
#include <xxhash.h>
static const uint16_t hash_crc16_ccitt_table[] = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
@@ -223,3 +226,7 @@ uint16_t hash_crc16_ccitt(const void* data, size_t size, bool make_upper) {
hash = (uint16_t)(hash_crc16_ccitt_table[(hash >> 8) ^ *d++] ^ (hash << 8));
return hash;
}
uint64_t hash_xxh3_64bits(const void* data, size_t size) {
return XXH3_64bits(data, size);
}