Saving binary file content in string to be able to md5 it and compare to other files later on
<p>I would like to save a md5 of a image file in a database so when a user sends another image I would like to be able to compare if the image already exists in the database, I have to know if theres already one of those in the database, I thought the easiest way would be to md5 the content of a file and then compare with the md5 output to see if they are equal or not.</p>

<p>how could I do that? if you think this is not very good to do, you could suggest something else to compare images without having the original file present at the moment, that's why I'm saving the md5 in the database.</p>

<p>I have the md5 function but I don't know what to md5, my md5 function accept a std::string parameter and return the result as a std::string.</p>

<p>Thank you in advance.</p>
