Classes | |
class | cplib::HashTable< T, Hash, Eq > |
Linear probing hash table with std non-compliant interface. More... | |
struct | cplib::WyHash< T > |
Hash function class like std::hash but uses wyhash. More... | |
Functions | |
static uint64_t | wyhash_bytes (const void *key, size_t len) |
Hash function for arbitrary bytes using wyhash. | |
static uint64_t | wyhash_combine (uint64_t a, uint64_t b) |
Combine two hash values to produce a new hash value. | |
|
related |
Hash function for arbitrary bytes using wyhash.
Calls wyhash from https://github.com/wangyi-fudan/wyhash/blob/master/wyhash.h, with a random seed initialized from system random source on startup.
Wyhash is chosen for several characteristics that are specially suited for competitive programming:
|
related |
Combine two hash values to produce a new hash value.
Calls wyhash64 from https://github.com/wangyi-fudan/wyhash/blob/master/wyhash.h.
Use this to implement hash function for types with multiple fields that are recursively hashed, similar to how boost::hash_combine is used for the same purpose.