libFirm
Loading...
Searching...
No Matches
Hash Functions

Functions

static unsigned hash_data (unsigned char const *data, size_t bytes)
 Returns a hash value for a block of data.
 
static unsigned hash_str (char const *const str)
 Returns a hash value for a string.
 
static unsigned hash_ptr (void const *const ptr)
 Returns a hash value for a pointer.
 
static unsigned hash_combine (unsigned const x, unsigned const y)
 Combines 2 hash values.
 

Detailed Description

Function Documentation

◆ hash_combine()

static unsigned hash_combine ( unsigned const x,
unsigned const y )
inlinestatic

Combines 2 hash values.

Parameters
xOne hash value.
yAnother hash value.
Returns
A hash value computed from both.

Definition at line 77 of file hashptr.h.

◆ hash_data()

static unsigned hash_data ( unsigned char const * data,
size_t bytes )
inlinestatic

Returns a hash value for a block of data.

Definition at line 34 of file hashptr.h.

◆ hash_ptr()

static unsigned hash_ptr ( void const *const ptr)
inlinestatic

Returns a hash value for a pointer.

Pointer addresses are mostly aligned to 4 or 8 bytes. So we remove the lowest 3 bits.

Definition at line 66 of file hashptr.h.

◆ hash_str()

static unsigned hash_str ( char const *const str)
inlinestatic

Returns a hash value for a string.

Parameters
strThe string (can be const).
Returns
A hash value for the string.

Definition at line 50 of file hashptr.h.