hashset.hpp

This commit is contained in:
Antonio SJ Musumeci 2025-01-11 19:22:55 -06:00
parent 7b1ba40d49
commit 80d74f33bb

View file

@ -20,6 +20,7 @@
#include "khash.h"
#include "wyhash.h"
#include <cstdint>
#define NAME str_set
#define KEY_TY const char*
@ -29,6 +30,18 @@
KHASH_SET_INIT_INT64(hashset);
static
inline
uint64_t
vt_hash_const_string(const char *key_)
{
int64_t hash = 0xcbf29ce484222325ull;
while( *key )
hash = ( (unsigned char)*key++ ^ hash ) * 0x100000001b3ull;
return hash;
}
class HashSet
{
public: