#include <iostream> /* C++ iostream C++98/11 */
#include <string> /* C++ strings C++98/11 */
// #include <boost/regex.hpp> /* RegEx Boost */
#include <boost/algorithm/string/replace.hpp>
using namespace std;
static uint32_t
Fnv1(const std::string& text)
{
constexpr uint32_t FNV_OFFSET = 0x811c9dc5;
constexpr uint32_t FNV_PRIME = 16777619;
uint32_t hash = FNV_OFFSET;
for (const char letter : text) {
hash *= FNV_PRIME;
hash ^= letter;
}
return hash;
}
int main() {
string obj {"1999#"};
uint32_t hash = Fnv1(obj);
cout<<hash<<endl;
cout<<hash%64<<endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPiAgICAgICAgICAgICAgICAvKiBDKysgaW9zdHJlYW0gICAgICAgICAgICBDKys5OC8xMSAqLwojaW5jbHVkZSA8c3RyaW5nPiAgICAgICAgICAgICAgICAgIC8qIEMrKyBzdHJpbmdzICAgICAgICAgICAgIEMrKzk4LzExICovCi8vICNpbmNsdWRlIDxib29zdC9yZWdleC5ocHA+ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUmVnRXggICAgICAgICAgICAgICAgICAgQm9vc3QgICovCiNpbmNsdWRlIDxib29zdC9hbGdvcml0aG0vc3RyaW5nL3JlcGxhY2UuaHBwPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0YXRpYyB1aW50MzJfdApGbnYxKGNvbnN0IHN0ZDo6c3RyaW5nJiB0ZXh0KQp7CiAgIGNvbnN0ZXhwciB1aW50MzJfdCBGTlZfT0ZGU0VUID0gMHg4MTFjOWRjNTsKICAgY29uc3RleHByIHVpbnQzMl90IEZOVl9QUklNRSA9IDE2Nzc3NjE5OwoKICAgdWludDMyX3QgaGFzaCA9IEZOVl9PRkZTRVQ7CiAgIGZvciAoY29uc3QgY2hhciBsZXR0ZXIgOiB0ZXh0KSB7CiAgICAgIGhhc2ggKj0gRk5WX1BSSU1FOwogICAgICBoYXNoIF49IGxldHRlcjsKICAgfQoKICAgcmV0dXJuIGhhc2g7Cn0KCmludCBtYWluKCkgewoKCXN0cmluZyBvYmogeyIxOTk5IyJ9OwoJdWludDMyX3QgaGFzaCA9IEZudjEob2JqKTsKCQoJCiAgICAKCWNvdXQ8PGhhc2g8PGVuZGw7Cgljb3V0PDxoYXNoJTY0PDxlbmRsOwp9Cg==