Typedefs | Functions
hash.h File Reference

Hash functions. More...

Typedefs

typedef uint32_t(* vtm_hash_elem_fn )(union vtm_elem *el)
 

Functions

VTM_API uint32_t vtm_hash_str (const char *in)
 
VTM_API uint32_t vtm_hash_strcase (const char *in)
 
VTM_API uint32_t vtm_hash_ptr (const void *in)
 
VTM_API uint32_t vtm_hash_mem (const void *in, size_t len)
 
VTM_API uint32_t vtm_hash_num (int64_t in)
 
VTM_API uint32_t vtm_hash_unum (uint64_t in)
 
VTM_API vtm_hash_elem_fn vtm_hash_elem_get_fn (enum vtm_elem_type type)
 
VTM_API uint32_t vtm_hash_elem_int8 (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_uint8 (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_int16 (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_uint16 (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_int32 (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_uint32 (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_int64 (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_uint64 (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_bool (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_char (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_schar (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_uchar (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_short (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_ushort (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_int (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_uint (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_long (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_ulong (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_float (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_double (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_str (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_strcase (union vtm_elem *el)
 
VTM_API uint32_t vtm_hash_elem_ptr (union vtm_elem *el)
 

Typedef Documentation

typedef uint32_t(* vtm_hash_elem_fn)(union vtm_elem *el)

Calculates the hash for given element.

Parameters
elthe element whose hash value should be calculated
Returns
the hash value

Function Documentation

VTM_API uint32_t vtm_hash_str ( const char *  in)

Calculates hash for given input string.

Parameters
inNUL-terminated input string
Returns
calculated hash value
VTM_API uint32_t vtm_hash_strcase ( const char *  in)

Calculates case-independent hash for given input string.

Parameters
inNUL-terminated input string
Returns
calculated hash value
VTM_API uint32_t vtm_hash_ptr ( const void *  in)

Calculates hash for given pointer.

Parameters
ina pointer
Returns
calculated hash value
VTM_API uint32_t vtm_hash_mem ( const void *  in,
size_t  len 
)

Calculates hash over given memory region.

Parameters
inpointer to memory region
lenlength in bytes of memory region
Returns
calculated hash value
VTM_API uint32_t vtm_hash_num ( int64_t  in)

Calculates hash for given signed integer.

Parameters
in64bit signed integer
Returns
calculated hash value
VTM_API uint32_t vtm_hash_unum ( uint64_t  in)

Calculates hash for given unsigned integer.

Parameters
in64bit unsigned integer
Returns
calculated hash value
VTM_API vtm_hash_elem_fn vtm_hash_elem_get_fn ( enum vtm_elem_type  type)

Gets a function pointer to the appropriate element hash function.

Parameters
typethe element type
Returns
function pointer to element hash function