Skip to content

acl/core/hash.h

#include "acl/core/hash.h"

The FNV-1a hash functions.

hash32

uint32_t hash32(const void* buffer, size_t buffer_size)

Returns the 32 bit hash of the provided buffer and size in bytes.

template<typename ElementType>
uint32_t hash32(const ElementType& element)

Returns the 32 bit hash of the provided element.

uint32_t hash32(const char* str)

Returns the 32 bit hash of the provided string. The null terminator not included in the hash.

hash64

uint64_t hash64(const void* buffer, size_t buffer_size)

Returns the 64 bit hash of the provided buffer and size in bytes.

template<typename ElementType>
uint64_t hash64(const ElementType& element)

Returns the 64 bit hash of the provided element.

uint64_t hash64(const char* str)

Returns the 64 bit hash of the provided string. The null terminator not included in the hash.

hash_combine

uint32_t hash_combine(uint32_t hash_a, uint32_t hash_b)
uint64_t hash_combine(uint64_t hash_a, uint64_t hash_b)

Combines two hashes into a new one.