Check SHA or MD5 sums on Windows

I know I should do this more often on my own machine, but I am weak. However, it is a necessity when installing Open Source software at work that I check the checksums after download. I always forget how to do it and often laboriously check the whole thing with MK 1 human eyeball. Dumb.

So, to make it better, here’s the simple, command line way, to check the checksums.

You’ll need:

  1. cygwin installed
  2. cd’ed to the folder where you downloaded the installation file to.

echo "9819c6d21360f805cc17157c64c24672 apache-tomcat-7.0.42.exe" | sha1sum -c -

If it’s good you should get (depending on your gitbash/bash/etc shell you’re using):

apache-tomcat-7.0.42.exe: OK

If bad you get: 

apache-tomcat-7.0.42.exe: FAILED
md5sum: WARNING: 1 computed checksum did NOT match

or maybe

no properly formatted MD5 checksum lines found

Thanks to Les on upthescala

EDIT 20130816: Fixed typo in command to remove pipe and replace with redirect.
EDIT 20140128: What was I thinking on previous edit? Anyway, fixed and added a little more colour.