|
a/src/utils/md5.cpp |
|
b/src/utils/md5.cpp |
|
... |
|
... |
366 |
|
366 |
|
367 |
#include "readfile.h"
|
367 |
#include "readfile.h"
|
368 |
class FileScanMd5 : public FileScanDo {
|
368 |
class FileScanMd5 : public FileScanDo {
|
369 |
public:
|
369 |
public:
|
370 |
FileScanMd5(string& d) : digest(d) {}
|
370 |
FileScanMd5(string& d) : digest(d) {}
|
371 |
virtual bool init(unsigned int size, string *reason)
|
371 |
virtual bool init(unsigned int size, string *)
|
372 |
{
|
372 |
{
|
373 |
MD5Init(&ctx);
|
373 |
MD5Init(&ctx);
|
374 |
return true;
|
374 |
return true;
|
375 |
}
|
375 |
}
|
376 |
virtual bool data(const char *buf, int cnt, string* reason)
|
376 |
virtual bool data(const char *buf, int cnt, string*)
|
377 |
{
|
377 |
{
|
378 |
MD5Update(&ctx, (const unsigned char*)buf, cnt);
|
378 |
MD5Update(&ctx, (const unsigned char*)buf, cnt);
|
379 |
return true;
|
379 |
return true;
|
380 |
}
|
380 |
}
|
381 |
string &digest;
|
381 |
string &digest;
|