All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kzc_hash_code.h File Reference

General purpose hash code functions. More...

Macros

#define KZ_KNUTH_HASH_MUL
 Knuth's hash multiplier for 32-bit constants. More...
 

Typedefs

typedef kzU32(* KzcHashFunction )(const void *object)
 Custom hash function definition. More...
 

Functions

KZ_INLINE kzU32 kzcHashCodeFromUint (kzUint value)
 Hash code function for unsigned integers. More...
 
KZ_INLINE kzU32 kzcHashCodeFromFloat (kzFloat value)
 Hash code function for floats. More...
 
KZ_INLINE kzU32 kzcHashCodeFromInt (kzInt value)
 Hash code function for signed integers. More...
 
KZ_INLINE kzU32 kzcHashCodeFromPointerUint (kzUint value)
 Hash code function for pointers that are already casted to uints. More...
 
KZ_INLINE kzU32 kzcHashCodeFromPointer (const void *value)
 Hash code function for pointers. More...
 
KZ_INLINE kzU32 kzcHashCodeFromString (kzString value)
 Hash code function for strings. More...
 

Detailed Description

General purpose hash code functions.

Hash code and comparator is related such that for two objects a and b if compare(a,b) == 0 then hashCode(a) == hashCode(b).

Copyright 2008-2020 by Rightware. All rights reserved.

Macro Definition Documentation

#define KZ_KNUTH_HASH_MUL

Knuth's hash multiplier for 32-bit constants.

Typedef Documentation

typedef kzU32(* KzcHashFunction)(const void *object)

Custom hash function definition.

Function Documentation

KZ_INLINE kzU32 kzcHashCodeFromUint ( kzUint  value)

Hash code function for unsigned integers.

KZ_INLINE kzU32 kzcHashCodeFromFloat ( kzFloat  value)

Hash code function for floats.

KZ_INLINE kzU32 kzcHashCodeFromInt ( kzInt  value)

Hash code function for signed integers.

KZ_INLINE kzU32 kzcHashCodeFromPointerUint ( kzUint  value)

Hash code function for pointers that are already casted to uints.

KZ_INLINE kzU32 kzcHashCodeFromPointer ( const void *  value)

Hash code function for pointers.

KZ_INLINE kzU32 kzcHashCodeFromString ( kzString  value)

Hash code function for strings.