lookup3.h File Reference

This file contains header definitions for the hash functions we use. More...

Functions

uint32_t hashword (const uint32_t *k, size_t length, uint32_t initval)
 Hash key made of 4byte chunks. More...
 
uint32_t hashlittle (const void *k, size_t length, uint32_t initval)
 Hash key data. More...
 
void hash_set_raninit (uint32_t v)
 Set the randomisation initial value, set this before threads start, and before hashing stuff (because it changes subsequent results). More...
 

Detailed Description

This file contains header definitions for the hash functions we use.

The hash functions are public domain (see lookup3.c).

Function Documentation

◆ hashword()

uint32_t hashword ( const uint32_t *  k,
size_t  length,
uint32_t  initval 
)

Hash key made of 4byte chunks.

Parameters
kthe key, an array of uint32_t values
lengththe length of the key, in uint32_ts
initvalthe previous hash, or an arbitrary value
Returns
: hash value.

◆ hashlittle()

uint32_t hashlittle ( const void *  k,
size_t  length,
uint32_t  initval 
)

Hash key data.

Parameters
kthe key, array of uint8_t
lengththe length of the key, in uint8_ts
initvalthe previous hash, or an arbitrary value
Returns
: hash value.

Referenced by dname_pkt_hash(), dname_query_hash(), dnsc_nonce_cache_key_hash(), dnsc_shared_secrets_cache_key(), hash_addr(), key_entry_hash(), pkt_hash_rrset(), pkt_hash_rrset_rest(), query_info_hash(), and rrset_key_hash().

◆ hash_set_raninit()

void hash_set_raninit ( uint32_t  v)

Set the randomisation initial value, set this before threads start, and before hashing stuff (because it changes subsequent results).

Parameters
vvalue

Referenced by libworker_setup().