NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Typedefs | Enumerations | Functions
xxhash.c File Reference
#include "xxhash.h"
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Classes

struct  _U32_S
 
struct  _U64_S
 
struct  XXH_istate32_t
 
struct  XXH_istate64_t
 

Macros

#define XXH_FORCE_NATIVE_FORMAT   0
 
#define FORCE_INLINE   static
 
#define _PACKED
 
#define A32(x)   (((U32_S *)(x))->v)
 
#define A64(x)   (((U64_S *)(x))->v)
 
#define GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)
 
#define XXH_rotl32(x, r)   ((x << r) | (x >> (32 - r)))
 
#define XXH_rotl64(x, r)   ((x << r) | (x >> (64 - r)))
 
#define PRIME32_1   2654435761U
 
#define PRIME32_2   2246822519U
 
#define PRIME32_3   3266489917U
 
#define PRIME32_4   668265263U
 
#define PRIME32_5   374761393U
 
#define PRIME64_1   11400714785074694791ULL
 
#define PRIME64_2   14029467366897019727ULL
 
#define PRIME64_3   1609587929392839161ULL
 
#define PRIME64_4   9650029242287828579ULL
 
#define PRIME64_5   2870177450012600261ULL
 
#define XXH_CPU_LITTLE_ENDIAN   (*(char*)(&one))
 
#define XXH_STATIC_ASSERT(c)   { enum { XXH_static_assert = 1/(!!(c)) }; } /* use only *after* variable declarations */
 
#define XXH_get32bits(p)   XXH_readLE32_align(p, endian, align)
 
#define XXH_get64bits(p)   XXH_readLE64_align(p, endian, align)
 

Typedefs

typedef unsigned char BYTE
 
typedef unsigned short U16
 
typedef unsigned int U32
 
typedef signed int S32
 
typedef unsigned long long U64
 
typedef struct _U32_S U32_S
 
typedef struct _U64_S U64_S
 

Enumerations

enum  XXH_endianess { XXH_bigEndian =0, XXH_littleEndian =1 }
 
enum  XXH_alignment { XXH_aligned, XXH_unaligned }
 

Functions

FORCE_INLINE U32 XXH_readLE32_align (const void *ptr, XXH_endianess endian, XXH_alignment align)
 
FORCE_INLINE U32 XXH_readLE32 (const void *ptr, XXH_endianess endian)
 
FORCE_INLINE U64 XXH_readLE64_align (const void *ptr, XXH_endianess endian, XXH_alignment align)
 
FORCE_INLINE U64 XXH_readLE64 (const void *ptr, XXH_endianess endian)
 
FORCE_INLINE U32 XXH32_endian_align (const void *input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align)
 
unsigned int XXH32 (const void *input, size_t len, unsigned seed)
 
FORCE_INLINE U64 XXH64_endian_align (const void *input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align)
 
unsigned long long XXH64 (const void *input, size_t len, unsigned long long seed)
 
XXH32_state_tXXH32_createState (void)
 
XXH_errorcode XXH32_freeState (XXH32_state_t *statePtr)
 
XXH64_state_tXXH64_createState (void)
 
XXH_errorcode XXH64_freeState (XXH64_state_t *statePtr)
 
XXH_errorcode XXH32_reset (XXH32_state_t *state_in, U32 seed)
 
XXH_errorcode XXH64_reset (XXH64_state_t *state_in, unsigned long long seed)
 
FORCE_INLINE XXH_errorcode XXH32_update_endian (XXH32_state_t *state_in, const void *input, size_t len, XXH_endianess endian)
 
XXH_errorcode XXH32_update (XXH32_state_t *state_in, const void *input, size_t len)
 
FORCE_INLINE U32 XXH32_digest_endian (const XXH32_state_t *state_in, XXH_endianess endian)
 
U32 XXH32_digest (const XXH32_state_t *state_in)
 
FORCE_INLINE XXH_errorcode XXH64_update_endian (XXH64_state_t *state_in, const void *input, size_t len, XXH_endianess endian)
 
XXH_errorcode XXH64_update (XXH64_state_t *state_in, const void *input, size_t len)
 
FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t *state_in, XXH_endianess endian)
 
unsigned long long XXH64_digest (const XXH64_state_t *state_in)
 

Macro Definition Documentation

#define _PACKED

Definition at line 124 of file xxhash.c.

#define A32 (   x)    (((U32_S *)(x))->v)

Definition at line 148 of file xxhash.c.

#define A64 (   x)    (((U64_S *)(x))->v)

Definition at line 149 of file xxhash.c.

#define FORCE_INLINE   static

Definition at line 81 of file xxhash.c.

#define GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)

Definition at line 155 of file xxhash.c.

#define PRIME32_1   2654435761U

Definition at line 197 of file xxhash.c.

#define PRIME32_2   2246822519U

Definition at line 198 of file xxhash.c.

#define PRIME32_3   3266489917U

Definition at line 199 of file xxhash.c.

#define PRIME32_4   668265263U

Definition at line 200 of file xxhash.c.

#define PRIME32_5   374761393U

Definition at line 201 of file xxhash.c.

#define PRIME64_1   11400714785074694791ULL

Definition at line 203 of file xxhash.c.

#define PRIME64_2   14029467366897019727ULL

Definition at line 204 of file xxhash.c.

#define PRIME64_3   1609587929392839161ULL

Definition at line 205 of file xxhash.c.

#define PRIME64_4   9650029242287828579ULL

Definition at line 206 of file xxhash.c.

#define PRIME64_5   2870177450012600261ULL

Definition at line 207 of file xxhash.c.

#define XXH_CPU_LITTLE_ENDIAN   (*(char*)(&one))

Definition at line 216 of file xxhash.c.

#define XXH_FORCE_NATIVE_FORMAT   0

Definition at line 64 of file xxhash.c.

#define XXH_get32bits (   p)    XXH_readLE32_align(p, endian, align)
#define XXH_get64bits (   p)    XXH_readLE64_align(p, endian, align)
#define XXH_rotl32 (   x,
 
)    ((x << r) | (x >> (32 - r)))

Definition at line 162 of file xxhash.c.

#define XXH_rotl64 (   x,
 
)    ((x << r) | (x >> (64 - r)))

Definition at line 163 of file xxhash.c.

#define XXH_STATIC_ASSERT (   c)    { enum { XXH_static_assert = 1/(!!(c)) }; } /* use only *after* variable declarations */

Definition at line 223 of file xxhash.c.

Typedef Documentation

typedef unsigned char BYTE

Definition at line 114 of file xxhash.c.

typedef signed int S32

Definition at line 117 of file xxhash.c.

typedef unsigned short U16

Definition at line 115 of file xxhash.c.

typedef unsigned int U32

Definition at line 116 of file xxhash.c.

typedef struct _U32_S U32_S
typedef unsigned long long U64

Definition at line 118 of file xxhash.c.

typedef struct _U64_S U64_S

Enumeration Type Documentation

Enumerator
XXH_aligned 
XXH_unaligned 

Definition at line 229 of file xxhash.c.

Enumerator
XXH_bigEndian 
XXH_littleEndian 

Definition at line 213 of file xxhash.c.

Function Documentation

unsigned int XXH32 ( const void *  input,
size_t  len,
unsigned  seed 
)

Definition at line 338 of file xxhash.c.

XXH32_state_t* XXH32_createState ( void  )

Definition at line 536 of file xxhash.c.

U32 XXH32_digest ( const XXH32_state_t state_in)

Definition at line 731 of file xxhash.c.

FORCE_INLINE U32 XXH32_digest_endian ( const XXH32_state_t state_in,
XXH_endianess  endian 
)

Definition at line 689 of file xxhash.c.

FORCE_INLINE U32 XXH32_endian_align ( const void *  input,
size_t  len,
U32  seed,
XXH_endianess  endian,
XXH_alignment  align 
)

Definition at line 261 of file xxhash.c.

XXH_errorcode XXH32_freeState ( XXH32_state_t statePtr)

Definition at line 541 of file xxhash.c.

XXH_errorcode XXH32_reset ( XXH32_state_t state_in,
U32  seed 
)

Definition at line 561 of file xxhash.c.

XXH_errorcode XXH32_update ( XXH32_state_t state_in,
const void *  input,
size_t  len 
)

Definition at line 677 of file xxhash.c.

FORCE_INLINE XXH_errorcode XXH32_update_endian ( XXH32_state_t state_in,
const void *  input,
size_t  len,
XXH_endianess  endian 
)

Definition at line 588 of file xxhash.c.

unsigned long long XXH64 ( const void *  input,
size_t  len,
unsigned long long  seed 
)

Definition at line 478 of file xxhash.c.

XXH64_state_t* XXH64_createState ( void  )

Definition at line 547 of file xxhash.c.

unsigned long long XXH64_digest ( const XXH64_state_t state_in)

Definition at line 925 of file xxhash.c.

FORCE_INLINE U64 XXH64_digest_endian ( const XXH64_state_t state_in,
XXH_endianess  endian 
)

Definition at line 843 of file xxhash.c.

FORCE_INLINE U64 XXH64_endian_align ( const void *  input,
size_t  len,
U64  seed,
XXH_endianess  endian,
XXH_alignment  align 
)

Definition at line 366 of file xxhash.c.

XXH_errorcode XXH64_freeState ( XXH64_state_t statePtr)

Definition at line 552 of file xxhash.c.

XXH_errorcode XXH64_reset ( XXH64_state_t state_in,
unsigned long long  seed 
)

Definition at line 574 of file xxhash.c.

XXH_errorcode XXH64_update ( XXH64_state_t state_in,
const void *  input,
size_t  len 
)

Definition at line 831 of file xxhash.c.

FORCE_INLINE XXH_errorcode XXH64_update_endian ( XXH64_state_t state_in,
const void *  input,
size_t  len,
XXH_endianess  endian 
)

Definition at line 742 of file xxhash.c.

FORCE_INLINE U32 XXH_readLE32 ( const void *  ptr,
XXH_endianess  endian 
)

Definition at line 239 of file xxhash.c.

FORCE_INLINE U32 XXH_readLE32_align ( const void *  ptr,
XXH_endianess  endian,
XXH_alignment  align 
)

Definition at line 231 of file xxhash.c.

FORCE_INLINE U64 XXH_readLE64 ( const void *  ptr,
XXH_endianess  endian 
)

Definition at line 252 of file xxhash.c.

FORCE_INLINE U64 XXH_readLE64_align ( const void *  ptr,
XXH_endianess  endian,
XXH_alignment  align 
)

Definition at line 244 of file xxhash.c.