blob: 95a3914384fbea0e415999c2efee9f28435a89bd [file] [edit]
#define XXH_INLINE_ALL
#include <inttypes.h>
#include <stdio.h>
#include "xxhash.h"
int main() {
// it seems this has to be exactly 24 bytes.
union {
char x[24];
// force 8-byte alignment without making
// aliasable with uint64_t.
void *y[3];
} data = {.x = { /* "garblegarblegarblegarble", without terminating NUL */
'g','a','r','b','l','e','g','a','r','b','l','e',
'g','a','r','b','l','e','g','a','r','b','l','e' }};
uint64_t hash = XXH64(&data, sizeof(data), 0);
printf("%016"PRIx64"\n", hash);
return 0;
}