Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make md5 calcation base on ppsspp
#4
I found another md5 calc ,so that it is easier to calc 262144 bytes.
Please correct me if I am wrong
Code:
std::string MD5_262144_File(const Path filename) { std::ifstream is(filename.c_str(), std::ifstream::binary); md5_context c; md5_starts(&c); char buf[256]; // 256 * 1024 = 262144 byte for (size_t i = 0; i < 1024; ++i) { is.read(buf, sizeof(buf)); md5_update(&c, (unsigned char*)buf, is.gcount()); } unsigned char out[16]; md5_finish(&c, out); std::string res; for (size_t i = 0; i < 16; ++i) { res.push_back(hb2hex(out[i] >> 4)); res.push_back(hb2hex(out[i])); } return res; }
I want to be a crash fixer
PM me if you want to me look a game
Reply


Messages In This Thread
Make md5 calcation base on ppsspp - by sum2012 - 07-30-2022, 09:10 AM
RE: Make md5 calcation base on ppsspp - by sum2012 - 07-31-2022, 10:48 AM

Forum Jump: