Consider the scenario when you are downloading something and the web site says it has a hash value (i.e, sha1sum, md5). This hash value will be used to verify whether the file you downloaded is OK (i.e., not corrupted.) If you are new to this stuff, you may wondering how in the world can I use such information for verification. Here's how.
After the download you need to compute for the hash value of the file. You can do it using:
for Fedora:
sha1sum
md5sum
for Ubuntu:
md5deep
In Fedora, you need to use sha1sum if sha1 hash is used by the distributors otherwise, md5sum. While Ubuntu got a "all in one" message digest program -- md5deep. Meaning it can compute md5 and sha1 hashes. Depending on the file size, these utilities might take a while to compute.
For our purpose, we need to redirect our output to a file. For example,
sha1sum Fedora-10-i386-DVD.iso > outfile.sha
We need to edit the output file (outfile.sha) so that we will just be focusing on the hash value. So, use your favourite editor and edit the output file. Remove anything that is not part of the hash. For example, this might be the output of computing the hash of Fedora 10 dvd;
086fd570518ac58d3966c43c1b6d146e38919d8d Fedora-10-i386-DVD.iso
the first part is the hash and the second part is the file name, the first part is the one we need. Remove the space following the first part and then the second part.
GO back to the web site that provided the hash value and save in another file (i.e., inetfile.sha). The two files, outfile.sha and inetfile.sha, must stored on the same path.
And this is now the time to use the diff utility. Issue the command:
diff outfile.sha inetfile.sha
If it returns nothing, then your downloaded file is OK otherwise you may need to re-download it.
Fin.