# Image file hash

**URL:** <https://mworks.discourse.group/t/image-file-hash/666>\
**Category:** Support\
**Created:** [March 9, 2012, 2:08pm UTC](https://mworks.discourse.group/t/image-file-hash/666 "2012-03-09T14:08:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [March 9, 2012, 2:08pm UTC](https://mworks.discourse.group/t/image-file-hash/666/1 "2012-03-09T14:08:01Z")

</div>

Hi Chris,

I have few questions about the image hashing algorithm in MWorks.

Is hashing based on pixel values or is it done for file (binary data)?  
(My guess is that it’s done for pixel values otherwise  
hash will depend on the file type for example.)

Also, could you let me know which hashing algorithm is used?

And, if hashing is done for pixel values, would you mind  
if I ask a small utility program (command line program would be nice)  
that gives me the hash value of a given image file?  
I would like to use this “standard” hashing program  
when I build a common image library for the lab.

Thanks,  
Ha

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [March 9, 2012, 2:36pm UTC](https://mworks.discourse.group/t/image-file-hash/666/2 "2012-03-09T14:36:08Z")

</div>

Hi Ha,

The hash value is the SHA-1 hash of the whole file, not the pixel values. This makes the hashing process fast, simple, and robust, at the cost of generating different hash values for images with identical pixel content but distinct packaging (e.g. two PNGs that differ only in their metadata).

For more info, please see [Using the file hash to verify an image stimulus](https://mworks.tenderapp.com/kb/stimuli/using-the-file-hash-to-verify-an-image-stimulus).

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 11:44pm UTC](https://mworks.discourse.group/t/image-file-hash/666/3 "2022-07-19T23:44:28Z")

</div>


