Files
hashtool/hasher.cpp
2018-05-16 17:14:44 +00:00

29 lines
717 B
C++

/* hash output tool for generating SOE style (broken...) SUID hashes
along with the more proper way to do so without negatives
written by Apathy
improved with output of broken version by Darth
License: just don't be a dick
*/
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <string>
#include <utility>
int main() {
std::string name;
std::cout << "What is your username? ";
getline(std::cin, name);
if (name.size() > 15) {
name.resize(15);
}
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
std::cout << "Username [" << name << "] StationID [" << static_cast<uint32_t>(std::hash < std::string > {}(name.c_str())) << "]\n";
}