smats  0.0.1
Satisfability Modulo Arithmetic Theories Symbols
Loading...
Searching...
No Matches
smats::hash::FNV1a Class Reference

#include <hash.hpp>

Public Types

using result_type = size_t
 

Public Member Functions

void operator() (const void *data, const size_t length) noexcept
 
constexpr void add_byte (const uint8_t byte) noexcept
 
constexpr operator size_t () const noexcept
 

Private Attributes

result_type hash_ {0xcbf29ce484222325u}
 FNV-1a offset basis.
 

Static Private Attributes

static constexpr size_t k_fnv_prime = 1099511628211u
 FNV-1a prime.
 

Detailed Description

FNV-1a hash algorithm.

This is a 64-bit implementation of the FNV-1a hash algorithm used by hash_append. See FNV-1a for details.

Member Function Documentation

◆ add_byte()

void smats::hash::FNV1a::add_byte ( const uint8_t byte)
inlineconstexprnoexcept

Append a byte into this hash.

Parameters
bytebyte to hash

◆ operator size_t()

smats::hash::FNV1a::operator size_t ( ) const
inlineexplicitconstexprnoexcept

Get read-only access to the hash value of the FNV1a algorithm.

Returns
hash value of the FNV1a algorithm

◆ operator()()

void smats::hash::FNV1a::operator() ( const void * data,
const size_t length )
inlinenoexcept

Append [data, data + length) bytes into this hash.

Parameters
datadata to hash
lengthlength of the data

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