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: