The check argument generates the sha1 hash of filename and compares it with the value stored in filename.sha1. If it matches OK is displayed and the exit code for the command is 0
What are you people talking about? Yes, I get the concept behind sha1sum, but the info above is confusing to say the best. First, Ubuntu does not seem to have sha1sum files - just strings on a web page such as this for Mate 16.04 Beta 1:
To check the integrity of a downloaded .iso, one opens the terminal program, does "cd Downloads", then sha1sum <ubuntu-mate-16.04-beta1-desktop-i386.iso>. After a bit, the terminal will produce a hash such as
sha1sum
If you want to send the file together with its sha1sum output redirect the output to a file:
Send both files and the other party can do a...
It should show
OK
if thesha1
is correct.Without creating local file:
For checking, go to the directory that contains
filename
and run this command:Its very simple.
Navigate to the terminal and key in:
to check a sha1 hash use:
The check argument generates the sha1 hash of
filename
and compares it with the value stored infilename.sha1
. If it matchesOK
is displayed and the exit code for the command is 0For those who are on mac and don't have coreutils/sha1sum installed.
Example:
What are you people talking about? Yes, I get the concept behind sha1sum, but the info above is confusing to say the best. First, Ubuntu does not seem to have sha1sum files - just strings on a web page such as this for Mate 16.04 Beta 1:
To check the integrity of a downloaded .iso, one opens the terminal program, does "cd Downloads", then sha1sum <ubuntu-mate-16.04-beta1-desktop-i386.iso>. After a bit, the terminal will produce a hash such as
Next, we have to go to the web page and compare the strings to verify that the verification works. Not nearly as easy as it could be.
Python
Python has excellent
hashlib
library, that allows calculating multiple hashsums, includingsha1
. Here's a simple script that can do the job:Test run:
With a single file:
With glob: