char* qHashMd5File ( const char *  filepath,
size_t *  nbytes 
)

Get MD5 digested ASCII string

Parameters:
filepath file path
nbytes size of data. Set to NULL to digest end of file
Returns:
malloced 32+1 bytes digested ASCII string which is terminated by NULL character
Note:
If the nbytes is set, qHashMd5File() will try to digest at lease nbytes then store actual digested size into nbytes. So if you set nbytes to over size than file size, finally nbytes will have actual file size.
   // case of digesting entire file
   char *md5str = qHashMd5File("/tmp/test.dat, NULL);
   printf("%s\n", md5str);
   free(md5str);

   // case of nbytes is set to 1 bytes length
   size_t nbytes = 1;
   char *md5str = qHashMd5File("/tmp/test.dat, &nbytes);
   printf("%s %d\n", md5str, nbytes);
   free(md5str);

   // case of nbytes is set to over size
   size_t nbytes = 100000;
   char *md5str = qHashMd5File("/tmp/test.dat, &nbytes);
   printf("%s %d\n", md5str, nbytes);
   free(md5str);

Definition at line 135 of file qHash.c.


Generated on Mon Mar 26 07:00:51 2018 for JSOC_Documentation by  doxygen 1.5.7.1