Kea: isc::util::Hash64 Struct Reference

| Kea 2.2.0

Static Public Member Functions | Static Public Attributes | List of all members
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. More...
static uint64_t | hash (const uint8_t *data, size_t length)
| Compute the hash. More...

## Static Public Attributes
static const uint64_t | FNV_offset_basis = 14695981039346656037ull
| Offset basis. More...
static const uint64_t | FNV_prime = 1099511628211ull
| Prime. More...

## 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

  str | not 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

  data | data to hash
  length | length 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().

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:

- hash.h