xxHash 0.8.2
Extremely fast non-cryptographic hash function
Loading...
Searching...
No Matches
Modules | Macros | Typedefs | Enumerations | Functions
Public API

Modules

 XXH32 family
 
 XXH64 family
 
 XXH3 family
 

Macros

#define XXH_STATIC_LINKING_ONLY
 Gives access to internal state declaration, required for static allocation.
 
#define XXH_IMPLEMENTATION
 Gives access to internal definitions.
 
#define XXH_INLINE_ALL
 Exposes the implementation and marks all functions as inline.
 
#define XXH_PRIVATE_API
 Exposes the implementation without marking functions as inline.
 
#define XXH_NAMESPACE   /* YOUR NAME HERE */
 Emulate a namespace by transparently prefixing all symbols.
 
#define XXHASH_H_5627135585666179   1
 
#define XXH_PUBLIC_API   /* do nothing */
 Marks a global symbol.
 
#define XXH_PUBLIC_API   /* do nothing */
 Marks a global symbol.
 
#define XXH_CONSTF   /* disable */
 
#define XXH_PUREF
 
#define XXH_MALLOCF
 
#define XXH_VERSION_MAJOR   0
 
#define XXH_VERSION_MINOR   8
 
#define XXH_VERSION_RELEASE   2
 
#define XXH_VERSION_NUMBER   (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)
 Version number, encoded as two digits each.
 

Typedefs

typedef uint32_t XXH32_hash_t
 An unsigned 32-bit integer.
 

Enumerations

enum  XXH_errorcode { XXH_OK = 0 , XXH_ERROR }
 Exit code for the streaming API. More...
 

Functions

unsigned XXH_versionNumber (void)
 Obtains the xxHash version.
 
typedef uint64_t XXH64_hash_t
 An unsigned 64-bit integer.
 

Detailed Description

Contains details on the public xxHash functions.

Macro Definition Documentation

◆ XXH_STATIC_LINKING_ONLY

#define XXH_STATIC_LINKING_ONLY

Gives access to internal state declaration, required for static allocation.

Incompatible with dynamic linking, due to risks of ABI changes.

Usage:

#define XXH_STATIC_LINKING_ONLY
#include "xxhash.h"

◆ XXH_IMPLEMENTATION

#define XXH_IMPLEMENTATION

Gives access to internal definitions.

Usage:

#define XXH_STATIC_LINKING_ONLY
#define XXH_IMPLEMENTATION
#include "xxhash.h"

◆ XXH_INLINE_ALL

#define XXH_INLINE_ALL

Exposes the implementation and marks all functions as inline.

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.

◆ XXH_NAMESPACE

#define XXH_NAMESPACE   /* YOUR NAME HERE */

Emulate a namespace by transparently prefixing all symbols.

If you want to include and expose xxHash functions from within your own library, but also want to avoid symbol collisions with other libraries which may also include xxHash, you can use XXH_NAMESPACE to automatically prefix any public symbol from xxhash library with the value of XXH_NAMESPACE (therefore, avoid empty or numeric values).

Note that no change is required within the calling program as long as it includes xxhash.h: Regular symbol names will be automatically translated by this header.

Typedef Documentation

◆ XXH32_hash_t

typedef uint32_t XXH32_hash_t

An unsigned 32-bit integer.

Not necessarily defined to uint32_t but functionally equivalent.

◆ XXH64_hash_t

typedef uint64_t XXH64_hash_t

An unsigned 64-bit integer.

Not necessarily defined to uint64_t but functionally equivalent.

Enumeration Type Documentation

◆ XXH_errorcode

Exit code for the streaming API.

Enumerator
XXH_OK 

OK

XXH_ERROR 

Error

Function Documentation

◆ XXH_versionNumber()

unsigned XXH_versionNumber ( void  )

Obtains the xxHash version.

This is mostly useful when xxHash is compiled as a shared library, since the returned value comes from the library, as opposed to header file.

Returns
XXH_VERSION_NUMBER of the invoked library.