From 80d74f33bbea5c504038ba793b7dd2df1bf83506 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Sat, 11 Jan 2025 19:22:55 -0600 Subject: [PATCH] hashset.hpp --- src/hashset.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/hashset.hpp b/src/hashset.hpp index afc50c88..0137f9d9 100644 --- a/src/hashset.hpp +++ b/src/hashset.hpp @@ -20,6 +20,7 @@ #include "khash.h" #include "wyhash.h" +#include #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: