123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #ifndef _MF_MD5_H_
- #define _MF_MD5_H_
- #include <string>
- #include <fstream>
- extern "C"
- {
- bool _Md5_CheckFile(const char * srcFile, unsigned char* dst);
- }
- using namespace std;
- namespace mf
- {
-
- class CMD5
- {
- private:
- #define uint8 unsigned char
- #define uint32 unsigned int
- struct md5_context
- {
- uint32 total[2];
- uint32 state[4];
- uint8 buffer[64];
- };
- void md5_starts( struct md5_context *ctx );
- void md5_process( struct md5_context *ctx, uint8 data[64] );
- void md5_update( struct md5_context *ctx, uint8 *input, uint32 length );
- void md5_finish( struct md5_context *ctx, uint8 digest[16] );
- public:
-
- void GenerateMD5(unsigned char* buffer,int bufferlen);
- void GenerateMD5(ifstream &in);
- void GenerateMD5(const char * src_file);
-
- CMD5();
-
- CMD5(const char * md5src);
-
- CMD5(unsigned long* md5src);
-
- CMD5 operator +(CMD5 adder);
-
- bool operator ==(CMD5 cmper);
-
-
-
- string ToString();
- unsigned long m_data[4];
- };
- };
- #endif
|