initial commit
This commit is contained in:
26
xxhash.cc
Normal file
26
xxhash.cc
Normal file
@@ -0,0 +1,26 @@
|
||||
/* 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
|
||||
}
|
Reference in New Issue
Block a user