wxString FbImportBook::CalcMd5(wxInputStream& stream) { const size_t BUFSIZE = 1024; unsigned char buf[BUFSIZE]; md5_context md5; md5_starts( &md5 ); bool eof; do { size_t len = stream.Read(buf, BUFSIZE).LastRead(); eof = (len < BUFSIZE); md5_update( &md5, buf, (int) len ); } while (!eof); return Md5(md5); }
std::string dxm::util::CCrypto::Md5( const std::string& content ) { return Md5( content.data(), content.size() ); }