#include #include #include "md5.h" #include #include #include int main( int argc, char *argv[] ) { md5 mproc; md5sum sum; char hexstr[33]; struct stat s; stat( argv[1], &s ); char *buf = new char[s.st_size]; FILE *fh = fopen( argv[1], "rb" ); fread( buf, 1, s.st_size, fh ); fclose( fh ); memset( hexstr, 0, 33 ); mproc.sumData( &sum, buf, s.st_size ); mproc.sumToHex( &sum, hexstr ); printf("sum: %s\n", hexstr ); delete[] buf; return 0; }