UnicodeString __fastcall md5(UnicodeString Pass) { wchar_t *ww; MD5 *md; ww = Pass.w_str(); std::wstring wstr = ww; std::string str = std::string(wstr.begin(), wstr.end()); md = new MD5(); md->add(str.c_str(), str.length()); str = md->getHash(); return UnicodeString(str.c_str()); }
void Hashr::md5Hash(const char* file, path hash_item) { MD5 hash = MD5(file, 32); hashValue = hash.getHash(); ofstream fout; fout.open("C:/Users/darry/Desktop/MD5_HashTable.txt", ofstream::app); fout << hashValue << endl; fout.close(); //cout << "MD5: " << hashValue << endl; //cout << "MD5HashTable value: " << md5Table[hashValue] << endl; if (md5Table[hashValue] == hashValue) { suspect = true; } }
std::string getMd5(const boost::filesystem::path& path) { MD5 algorithm; hashFile(path, algorithm); return algorithm.getHash(); }