Hi i am trying to calculate sha1 hash for image.
Is there any function available to calulate hash of image directly?
Sorry i forgot to mention .. its in c++ i am trying.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Read the image file into memory, then call the SHA1 function on that. Python:
This will give you the SHA1 of the image, including the headers, comments, etc. that are stored with it in the file. Remember that SHA1 just transforms a string of bits to a different, fixed-size string of bits. There’s nothing magical about images as far as it is concerned.
EDIT: ok, C++. Get hashlib2plus, construct a
sha1wrapper, feed it the image block-by-block usingupdateContextand finallyhashIt.