TeoCCl library  0.1.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hash.c File Reference
#include <stdint.h>
#include <stddef.h>
#include "teoccl/hash.h"

Macros

#define get16bits(d)
 
#define hashsize(n)   ((uint32_t)1<<(n))
 
#define hashmask(n)   (hashsize(n)-1)
 
#define mix(a, b, c)
 

Functions

uint32_t teoHashSuperFast (const uint8_t *data, int len)
 
uint32_t teoHashFast (register const uint8_t *k, register uint32_t length, register uint32_t initval)
 

Macro Definition Documentation

#define get16bits (   d)
Value:
((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
+(uint32_t)(((const uint8_t *)(d))[0]) )

Referenced by teoHashSuperFast().

#define hashmask (   n)    (hashsize(n)-1)
#define hashsize (   n)    ((uint32_t)1<<(n))
#define mix (   a,
  b,
 
)
Value:
{ \
a -= b; a -= c; a ^= (c>>13); \
b -= c; b -= a; b ^= (a<<8); \
c -= a; c -= b; c ^= (b>>13); \
a -= b; a -= c; a ^= (c>>12); \
b -= c; b -= a; b ^= (a<<16); \
c -= a; c -= b; c ^= (b>>5); \
a -= b; a -= c; a ^= (c>>3); \
b -= c; b -= a; b ^= (a<<10); \
c -= a; c -= b; c ^= (b>>15); \
}

Referenced by teoHashFast().

Function Documentation

uint32_t teoHashFast ( register const uint8_t *  k,
register uint32_t  length,
register uint32_t  initval 
)

References mix.

uint32_t teoHashSuperFast ( const uint8_t *  data,
int  len 
)

References get16bits.