file
xxhash.hxxHash prototypes and implementation
Classes
- struct XXH32_canonical_t
- Canonical (big endian) representation of XXH32_hash_t.
- struct XXH64_canonical_t
- struct XXH128_hash_t
- The return value from 128-bit hashes.
- struct XXH128_canonical_t
Enums
- enum XXH_errorcode { XXH_OK = 0, XXH_ERROR }
Typedefs
- using XXH32_state_t = struct XXH32_state_s
- The opaque state struct for the XXH32 streaming API.
- using XXH64_state_t = struct XXH64_state_s
- The opaque state struct for the XXH64 streaming API.
- using XXH3_state_t = struct XXH3_state_s
- The state struct for the XXH3 streaming API.
Functions
- auto XXH_versionNumber(void) -> XXH_PUBLIC_API unsigned
- Obtains the xxHash version.
- auto XXH32(const void* input, size_t length, XXH32_hash_t seed) -> XXH_PUBLIC_API XXH32_hash_t
- Calculates the 32-bit hash of
input
using xxHash32. -
auto XXH32_createState(void) -> XXH_PUBLIC_API XXH32_
state_ t* - Allocates an XXH32_
state_ t. -
auto XXH32_freeState(XXH32_
state_ t* statePtr) -> XXH_PUBLIC_API XXH_errorcode - Frees an XXH32_
state_ t. -
auto XXH32_copyState(XXH32_
state_ t* dst_state, const XXH32_ state_ t* src_state) -> XXH_PUBLIC_API void - Copies one XXH32_
state_ t to another. -
auto XXH32_reset(XXH32_
state_ t* statePtr, XXH32_hash_t seed) -> XXH_PUBLIC_API XXH_errorcode - Resets an XXH32_
state_ t to begin a new hash. -
auto XXH32_update(XXH32_
state_ t* statePtr, const void* input, size_t length) -> XXH_PUBLIC_API XXH_errorcode - Consumes a block of
input
to an XXH32_state_ t. -
auto XXH32_digest(const XXH32_
state_ t* statePtr) -> XXH_PUBLIC_API XXH32_hash_t - Returns the calculated hash value from an XXH32_
state_ t. -
auto XXH32_canonicalFromHash(XXH32_
canonical_ t* dst, XXH32_hash_t hash) -> XXH_PUBLIC_API void - Converts an XXH32_hash_t to a big endian XXH32_
canonical_ t. -
auto XXH32_hashFromCanonical(const XXH32_
canonical_ t* src) -> XXH_PUBLIC_API XXH32_hash_t - Converts an XXH32_
canonical_ t to a native XXH32_hash_t. - auto XXH64(const void* input, size_t length, XXH64_hash_t seed) -> XXH_PUBLIC_API XXH64_hash_t
- Calculates the 64-bit hash of
input
using xxHash64. -
auto XXH64_createState(void) -> XXH_PUBLIC_API XXH64_
state_ t* -
auto XXH64_freeState(XXH64_
state_ t* statePtr) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH64_copyState(XXH64_
state_ t* dst_state, const XXH64_ state_ t* src_state) -> XXH_PUBLIC_API void -
auto XXH64_reset(XXH64_
state_ t* statePtr, XXH64_hash_t seed) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH64_update(XXH64_
state_ t* statePtr, const void* input, size_t length) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH64_digest(const XXH64_
state_ t* statePtr) -> XXH_PUBLIC_API XXH64_hash_t -
auto XXH64_canonicalFromHash(XXH64_
canonical_ t* dst, XXH64_hash_t hash) -> XXH_PUBLIC_API void -
auto XXH64_hashFromCanonical(const XXH64_
canonical_ t* src) -> XXH_PUBLIC_API XXH64_hash_t - auto XXH3_64bits(const void* data, size_t len) -> XXH_PUBLIC_API XXH64_hash_t
- auto XXH3_64bits_withSeed(const void* data, size_t len, XXH64_hash_t seed) -> XXH_PUBLIC_API XXH64_hash_t
- auto XXH3_64bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize) -> XXH_PUBLIC_API XXH64_hash_t
-
auto XXH3_createState(void) -> XXH_PUBLIC_API XXH3_
state_ t* -
auto XXH3_freeState(XXH3_
state_ t* statePtr) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_copyState(XXH3_
state_ t* dst_state, const XXH3_ state_ t* src_state) -> XXH_PUBLIC_API void -
auto XXH3_64bits_reset(XXH3_
state_ t* statePtr) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_64bits_reset_withSeed(XXH3_
state_ t* statePtr, XXH64_hash_t seed) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_64bits_reset_withSecret(XXH3_
state_ t* statePtr, const void* secret, size_t secretSize) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_64bits_update(XXH3_
state_ t* statePtr, const void* input, size_t length) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_64bits_digest(const XXH3_
state_ t* statePtr) -> XXH_PUBLIC_API XXH64_hash_t -
auto XXH3_128bits(const void* data,
size_t len) -> XXH_PUBLIC_API XXH128_
hash_ t -
auto XXH3_128bits_withSeed(const void* data,
size_t len,
XXH64_hash_t seed) -> XXH_PUBLIC_API XXH128_
hash_ t -
auto XXH3_128bits_withSecret(const void* data,
size_t len,
const void* secret,
size_t secretSize) -> XXH_PUBLIC_API XXH128_
hash_ t -
auto XXH3_128bits_reset(XXH3_
state_ t* statePtr) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_128bits_reset_withSeed(XXH3_
state_ t* statePtr, XXH64_hash_t seed) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_128bits_reset_withSecret(XXH3_
state_ t* statePtr, const void* secret, size_t secretSize) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_128bits_update(XXH3_
state_ t* statePtr, const void* input, size_t length) -> XXH_PUBLIC_API XXH_errorcode -
auto XXH3_128bits_digest(const XXH3_
state_ t* statePtr) -> XXH_PUBLIC_API XXH128_ hash_ t -
auto XXH128_isEqual(XXH128_
hash_ t h1, XXH128_ hash_ t h2) -> XXH_PUBLIC_API int - auto XXH128_cmp(const void* h128_1, const void* h128_2) -> XXH_PUBLIC_API int
-
auto XXH128_canonicalFromHash(XXH128_
canonical_ t* dst, XXH128_ hash_ t hash) -> XXH_PUBLIC_API void -
auto XXH128_hashFromCanonical(const XXH128_
canonical_ t* src) -> XXH_PUBLIC_API XXH128_ hash_ t
Defines
- #define XXHASH_H_5627135585666179
- #define XXH_PUBLIC_API
- #define XXH_VERSION_MAJOR
- #define XXH_VERSION_MINOR
- #define XXH_VERSION_RELEASE
- #define XXH_VERSION_NUMBER
Define documentation
#define XXHASH_H_5627135585666179
XXH_INLINE_ALL (and XXH_PRIVATE_API) Use these build macros to inline xxhash into the target unit. Inlining improves performance on small inputs, especially when the length is expressed as a compile-time constant:
https://fastcompression.blogspot.com/2018/03/xxhash-for-small-keys-impressive-power.html
It also keeps xxHash symbols private to the unit, so they are not exported.
Usage: #define XXH_INLINE_ALL #include "xxhash.h"
Do not compile and link xxhash.o as a separate object, as it is not useful.