libboxes
boxes is a set of specialised containers built on top of STL
|
Contains utilities for instantiating hash functions and hash families. More...
#include "compiler.hpp"
#include <concepts>
#include <cstdint>
#include <random>
#include <set>
#include <string>
#include <vector>
Go to the source code of this file.
Classes | |
class | boxes::hash::KirschMitzenmacher< H1, H2 > |
Abstracts a Kirsch-Mitzenmacher hash family functor. More... | |
class | boxes::hash::HashWithSeedFamily< HashT > |
Abstracts a hash family functor that requires a seed n times with different seed. More... | |
Concepts | |
concept | boxes::hash::Hash64 |
Defines a minimal interface for Hashing functor. | |
concept | boxes::hash::HashFamily64 |
Defines a minimal interface for HashFamily functor. | |
Functions | |
template<typename HashFamilyT , typename T > | |
uint64_t | boxes::hash::hashType64 (HashFamilyT &h, std::size_t idx, const T &t) |
Applies a given hash family to a type T More... | |
template<typename HashFamilyT > | |
uint64_t | boxes::hash::hashType64 (HashFamilyT &h, std::size_t idx, const std::string &s) |
Applies a given hash family to a string. More... | |
template<typename HashFamilyT , typename T > | |
uint64_t | boxes::hash::hashType64 (HashFamilyT &h, std::size_t idx, const std::vector< T > &v) |
Applies a given hash family to a vector of type T More... | |
template<typename HashFamilyT > | |
uint64_t | boxes::hash::hashType64 (HashFamilyT &h, std::size_t idx, const std::vector< std::string > &v) |
Applies a given hash family to a vector of strings. More... | |
template<Hash64 HT> | |
HT | boxes::hash::makeHashWithRandomSeed () |
Instantiates a hash function that requires a seed with a randomly generated seed. More... | |
template<Hash64 H1, Hash64 H2> | |
KirschMitzenmacher< H1, H2 > | boxes::hash::makeKirschMitzenmacher (H1 h1, H2 h2, std::size_t k) |
Helper function to instantiate a Kirsch-Mitzenmacher hash family. More... | |
Contains utilities for instantiating hash functions and hash families.
Copyright 2024 Tomasz Wisniewski twdev.nosp@m..blo.nosp@m.gger@.nosp@m.gmai.nosp@m.l.com
Definition in file hash_utils.hpp.
uint64_t boxes::hash::hashType64 | ( | HashFamilyT & | h, |
std::size_t | idx, | ||
const std::string & | s | ||
) |
Applies a given hash family to a string.
This is an overload for an adapter that applies a hash family to a string.
HashFamilyT | type of the hash family functor |
h | hash family functor instance |
idx | index of the hash function in the family |
s | string to be hashed |
Definition at line 96 of file hash_utils.hpp.
uint64_t boxes::hash::hashType64 | ( | HashFamilyT & | h, |
std::size_t | idx, | ||
const std::vector< std::string > & | v | ||
) |
Applies a given hash family to a vector of strings.
HashFamilyT | type of the hash family functor |
h | hash family functor instance |
idx | index of the hash function in the family |
v | vector of strings to be hashed |
Definition at line 127 of file hash_utils.hpp.
uint64_t boxes::hash::hashType64 | ( | HashFamilyT & | h, |
std::size_t | idx, | ||
const std::vector< T > & | v | ||
) |
Applies a given hash family to a vector of type T
HashFamilyT | type of the hash family functor |
T | type of the data stored in the vector |
h | hash family functor instance |
idx | index of the hash function in the family |
v | vector of data to be hashed |
Definition at line 112 of file hash_utils.hpp.
uint64_t boxes::hash::hashType64 | ( | HashFamilyT & | h, |
std::size_t | idx, | ||
const T & | t | ||
) |
Applies a given hash family to a type T
This is a generic overload for an adapter that applies a hash family to an instance of type T
.
HashFamilyT | type of the hash family functor |
T | type of the data to be hashed |
h | hash family functor instance |
idx | index of the hash function in the family |
t | data to be hashed |
Definition at line 79 of file hash_utils.hpp.
HT boxes::hash::makeHashWithRandomSeed | ( | ) |
Instantiates a hash function that requires a seed with a randomly generated seed.
HT | type of the hash functor |
Definition at line 142 of file hash_utils.hpp.
KirschMitzenmacher< H1, H2 > boxes::hash::makeKirschMitzenmacher | ( | H1 | h1, |
H2 | h2, | ||
std::size_t | k | ||
) |
Helper function to instantiate a Kirsch-Mitzenmacher hash family.
h1 | |
h2 | |
k |
Definition at line 254 of file hash_utils.hpp.