27 lines
483 B
C++
27 lines
483 B
C++
/* SPDX-License-Identifier: Apache-2.0
|
|
* (c) 2025, Konstantin Demin
|
|
*/
|
|
|
|
#ifndef _GNU_SOURCE
|
|
#define _GNU_SOURCE
|
|
#endif
|
|
|
|
#define XXH_IMPLEMENTATION
|
|
|
|
#include "xxhash.hh"
|
|
|
|
xxhash_t xxhash(const void * input, size_t len, xxhash_t seed)
|
|
{
|
|
#ifndef XXH_NO_LONG_LONG
|
|
XXH64_state_t st;
|
|
XXH64_reset(&st, seed);
|
|
XXH64_update(&st, input, len);
|
|
return XXH64_digest(&st);
|
|
#else
|
|
XXH32_state_t st;
|
|
XXH32_reset(&st, seed);
|
|
XXH32_update(&st, input, len);
|
|
return XXH32_digest(&st);
|
|
#endif
|
|
}
|