diff --git a/CMakeLists.txt b/CMakeLists.txt index 56b4131..a512151 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ set(CMAKE_CXX_FLAGS "-Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") -find_package( Threads ) -add_executable(${PROJECT_NAME} main.cpp) +find_package(Threads) +add_executable(${PROJECT_NAME} main.cpp include/xxhash.c) target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PUBLIC third_party) diff --git a/include/bank.hpp b/include/bank.hpp index 51e9320..cd91139 100644 --- a/include/bank.hpp +++ b/include/bank.hpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include "xxhash.h" #include "parallel-hashmap/parallel_hashmap/phmap.h" #include "user.hpp" @@ -137,7 +137,7 @@ public: res = (u.password == XXH64(attempt.data(), attempt.size(), 0)); if (res) { - u.password = std::hash{}(new_pass); + u.password = XXH64(new_pass.data(), new_pass.size(), 0); } }); return res;