예제 #1
0
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);
}
예제 #2
0
파일: util_crypto.cpp 프로젝트: dxmgame/dxm
std::string dxm::util::CCrypto::Md5( const std::string& content )
{
	return Md5( content.data(), content.size() );
}