When you download a file from the internet, the web site may also provide the SHA1 or MD5 of the file as a way to verify the integrity of the file. If you have OpenSSL installed in your machine, it has a handy dgst command to compute the SHA1 and MD5 of a file.
To compute the SHA1 of a file:
openssl dgst -sha1 filename
To compute the MD5 of a file:
openssl dgst -md5 filename
If you like to have a little more fun, you can even build your own with a very simple Java program.