0

OK so I use the following code to get a hash of a file and print it to the terminal. I want to then add this hash to a file with other text based data in it, so I assume I need to convert to ASCII somehow. I must also use the write() system call to do it and not fwrite(). Any ideas?

MD5((unsigned char*) buffer, filesize, md5result);
printf("File: %s Hash: ", filename);
for(j=0; j <MD5_DIGEST_LENGTH; j++) {
      printf("%02x",md5result[j]);
}
1
Contributor
1
Reply
5
Views
7 Years
Discussion Span
Last Post by fg_aa_c
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.