C++中内置的哈希函数对于哈希密码来说是相当安全的吗?例如像下面这样的代码:
这个是否相对安全呢?
#include <iostream>
#import <string>
int main ()
{
std::hash <std::string> hash;
std::string passwordGuess;
unsigned long hashedPassword = 1065148159544519853; // hash of password
std::cout << "Enter your password: ";
std::cin >> passwordGuess;
unsigned long hashedPasswordGuess = hash(passwordGuess);
if (hashedPasswordGuess == hashedPassword) {
std::cout << "Password is correct!" << std::endl;
} else {
std::cout << "Password is wrong!" << std::endl;
}
}
这个是否相对安全呢?