Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make md5 calcation base on ppsspp
07-31-2022, 10:48 AM
Post: #4
RE: Make md5 calcation base on ppsspp
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
Find all posts by this user
Quote this message in a reply
Post Reply 


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

Forum Jump: