1、生成hash
int stringToHash(string str) {
//std::string s = "Stand back! I've got jimmies!";
std::hash<std::string> hash_fn;
size_t hash = hash_fn(str);
//std::cout << hash << '\n';
return hash;
}
int stringToHash(string str) {
//std::string s = "Stand back! I've got jimmies!";
std::hash<std::string> hash_fn;
size_t hash = hash_fn(str);
//std::cout << hash << '\n';
return hash;
}
本文标题:c++之产生hash值
本文链接:https://www.haomeiwen.com/subject/ppafyctx.html
网友评论