Turnstone Operating System
Loading...
Searching...
No Matches
xxhash.h File Reference

xxHash - Extremely Fast Hash algorithm. More...

#include <types.h>

Macros

#define ___XXHASH_H   0
 
#define xxhash64_hash(i, l)   xxhash64_hash_with_seed(i, l, 0)
 calculate xxhash64 value with seed 0 More...
 
#define xxhash32_hash(i, l)   xxhash32_hash_with_seed(i, l, 0)
 calculate xxhash32 value with seed 0 More...
 

Typedefs

typedef struct xxhash64_context_t xxhash64_context_t
 opaque xxhash64 context structure
 
typedef struct xxhash32_context_t xxhash32_context_t
 opaque xxhash32 context structure
 

Functions

xxhash64_context_txxhash64_init (uint64_t seed)
 initialize xxhash64 context More...
 
int8_t xxhash64_update (xxhash64_context_t *ctx, const void *input, uint64_t length)
 update xxhash64 context More...
 
uint64_t xxhash64_final (xxhash64_context_t *ctx)
 finalize xxhash64 context More...
 
uint64_t xxhash64_hash_with_seed (const void *input, uint64_t length, uint64_t seed)
 calculate xxhash64 value More...
 
xxhash32_context_txxhash32_init (uint32_t seed)
 initialize xxhash32 context More...
 
int8_t xxhash32_update (xxhash32_context_t *ctx, const void *input, uint64_t length)
 update xxhash32 context More...
 
uint32_t xxhash32_final (xxhash32_context_t *ctx)
 finalize xxhash32 context More...
 
uint32_t xxhash32_hash_with_seed (const void *input, uint64_t length, uint32_t seed)
 calculate xxhash32 value More...
 

Detailed Description

xxHash - Extremely Fast Hash algorithm.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Macro Definition Documentation

◆ ___XXHASH_H

#define ___XXHASH_H   0

macro for preventing multiple inclusions

◆ xxhash32_hash

#define xxhash32_hash (   i,
 
)    xxhash32_hash_with_seed(i, l, 0)

calculate xxhash32 value with seed 0

Parameters
[in]iinput data
[in]linput data length
Returns
xxhash32 value

◆ xxhash64_hash

#define xxhash64_hash (   i,
 
)    xxhash64_hash_with_seed(i, l, 0)

calculate xxhash64 value with seed 0

Parameters
[in]iinput data
[in]linput data length
Returns
xxhash64 value

Function Documentation

◆ xxhash32_final()

uint32_t xxhash32_final ( xxhash32_context_t ctx)

finalize xxhash32 context

call this function after calling xxhash32_update(), also destroy xxhash32 context

Parameters
[in]ctxxxhash32 context
Returns
xxhash32 value

◆ xxhash32_hash_with_seed()

uint32_t xxhash32_hash_with_seed ( const void *  input,
uint64_t  length,
uint32_t  seed 
)

calculate xxhash32 value

Parameters
[in]inputinput data
[in]lengthinput data length
[in]seedseed value
Returns
xxhash32 value

◆ xxhash32_init()

xxhash32_context_t * xxhash32_init ( uint32_t  seed)

initialize xxhash32 context

Parameters
[in]seedseed value
Returns
xxhash32 context

◆ xxhash32_update()

int8_t xxhash32_update ( xxhash32_context_t ctx,
const void *  input,
uint64_t  length 
)

update xxhash32 context

Parameters
[in]ctxxxhash32 context
[in]inputinput data
[in]lengthinput data length
Returns
0 if success, -1 if error

◆ xxhash64_final()

uint64_t xxhash64_final ( xxhash64_context_t ctx)

finalize xxhash64 context

call this function after calling xxhash64_update(), also destroy xxhash64 context

Parameters
[in]ctxxxhash64 context
Returns
xxhash64 value

◆ xxhash64_hash_with_seed()

uint64_t xxhash64_hash_with_seed ( const void *  input,
uint64_t  length,
uint64_t  seed 
)

calculate xxhash64 value

Parameters
[in]inputinput data
[in]lengthinput data length
[in]seedseed value
Returns
xxhash64 value

◆ xxhash64_init()

xxhash64_context_t * xxhash64_init ( uint64_t  seed)

initialize xxhash64 context

Parameters
[in]seedseed value
Returns
xxhash64 context

◆ xxhash64_update()

int8_t xxhash64_update ( xxhash64_context_t ctx,
const void *  input,
uint64_t  length 
)

update xxhash64 context

Parameters
[in]ctxxxhash64 context
[in]inputinput data
[in]lengthinput data length
Returns
0 if success, -1 if error