Kea 2.7.6
isc::util::Hash64 Struct Reference

Hash implementation based on Fowler-Noll-Vo hash function. More...

#include <hash.h>

Static Public Member Functions

static uint64_t hash (const std::string &str)
 Compute the hash.
 
static uint64_t hash (const uint8_t *data, size_t length)
 Compute the hash.
 

Static Public Attributes

static const uint64_t FNV_offset_basis = 14695981039346656037ull
 Offset basis.
 
static const uint64_t FNV_prime = 1099511628211ull
 Prime.
 

Detailed Description

Hash implementation based on Fowler-Noll-Vo hash function.

Definition at line 19 of file hash.h.

Member Function Documentation

◆ hash() [1/2]

static uint64_t isc::util::Hash64::hash ( const std::string & str)
inlinestatic

Compute the hash.

FNV-1a hash function

Parameters
strnot empty string to hash
Returns
the hash value

Definition at line 42 of file hash.h.

References hash().

+ Here is the call graph for this function:

◆ hash() [2/2]

static uint64_t isc::util::Hash64::hash ( const uint8_t * data,
size_t length )
inlinestatic

Compute the hash.

FNV-1a hash function

Parameters
datadata to hash
lengthlength of data
Returns
the hash value

Definition at line 27 of file hash.h.

References FNV_offset_basis, FNV_prime, and hash().

Referenced by hash(), and hash().

+ Here is the call graph for this function:

Member Data Documentation

◆ FNV_offset_basis

const uint64_t isc::util::Hash64::FNV_offset_basis = 14695981039346656037ull
static

Offset basis.

Definition at line 48 of file hash.h.

Referenced by hash().

◆ FNV_prime

const uint64_t isc::util::Hash64::FNV_prime = 1099511628211ull
static

Prime.

Definition at line 51 of file hash.h.

Referenced by hash().


The documentation for this struct was generated from the following file: