MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / file_test

Function file_test

extra/yassl/taocrypt/test/test.cpp:336–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334
335
336void file_test(const char* file, byte* check)
337{
338 FILE* f;
339 int i = 0;
340 MD5 md5;
341 byte buf[1024];
342 byte md5sum[MD5::DIGEST_SIZE];
343
344 if( !( f = fopen( file, "rb" ) )) {
345 printf("Can't open %s\n", file);
346 return;
347 }
348 while( ( i = (int)fread(buf, 1, sizeof(buf), f )) > 0 )
349 md5.Update(buf, i);
350
351 md5.Final(md5sum);
352 memcpy(check, md5sum, sizeof(md5sum));
353
354 for(int j = 0; j < MD5::DIGEST_SIZE; ++j )
355 printf( "%02x", md5sum[j] );
356
357 printf(" %s\n", file);
358
359 fclose(f);
360}
361
362
363int sha_test()

Callers 1

mainFunction · 0.85

Calls 2

UpdateMethod · 0.45
FinalMethod · 0.45

Tested by

no test coverage detected