Sha1sum
From Wikipedia, the free encyclopedia
- The correct title of this article is sha1sum. The initial letter is shown capitalized due to technical restrictions.
sha1sum is a computer program which calculates and verifies SHA1 hashes. It is commonly used to verify the integrity of files. It is installed by default in most Unix, Linux and BSD operating systems. Versions for Microsoft Windows do exist (see external links).
[edit] Usage
To calculate the SHA1 hash of a file, simply give the filename as an argument to sha1sum
.
$ sha1sum somefile da39a3ee5e6b4b0d3255bfef95601890afd80709 somefile
The output of sha1sum
can be saved into a text file and used to verify the integrity of a file. If the output above is stored in the file somefile.sha1
, the following command will compare the SHA1 hash of somefile
with the hash stored in somefile.sha1
.
$ sha1sum -c somefile.sha1 somefile: OK
The sha1sum
command can also be used in an interactive mode to calculate the SHA1 hash of any arbitrary string of characters. After typing the sha1sum
command without any arguments, type the string of characters in the terminal. End the string with an End-of-file character. The SHA1 hash will be displayed on the terminal next to the input string. For example:
$ sha1sum somestring CTRL+D CRTL+D
will result in the following output.
$ sha1sum somestringda63fb69aeb03c776bd23e91e2c1cb3df30135d3 -
[edit] See also
[edit] External links
- The program's manpage
- An implemention for Microsoft Windows
- The sha1sum program is part of the GNU coreutils package