write first version of user system

This commit is contained in:
2024-05-21 13:12:50 +00:00
parent 5ae88e3312
commit d2a15115cf
10 changed files with 399 additions and 53 deletions

View File

@ -0,0 +1,17 @@
#include <iostream>
#include <string>
#include <unordered_map>
#include "../src/include/utils.h"
std::unordered_map<hash_t, std::string> storage;
int main() {
std::string token;
while (std::cin >> token) {
hash_t hsh = SplitMix64Hash(token);
if (storage.find(hsh) == storage.end()) {
storage[hsh] = token;
} else if (storage[hsh] != token) {
std::cerr << "Collision detected: " << storage[hsh] << " " << token << std::endl;
}
}
return 0;
}