Problem: To get the sha1sum value of a file in MAC OS i run the following command
sha1sum file_name
The error I got is following
perl version 5.18.2 can't run /usr/bin/sha1sum. Try the alternative(s): /usr/bin/sha1sum5.16 (uses perl 5.16) Run "man perl" for more information about multiple version support in Mac OS X.
I tried to install textutils and coreutils, but both failed. Can anyone suggest me how I can resolve the issue ? Thanks in advance.
Or you can type the command openssl sha1 followed by space and drag and drop the file to the Terminal. Wait a while and you should see SHA1(/the/full/path/to/your/file)= followed by the checksum.
You can easily check the MD5 Hash of any file on your Mac, all you need to do is launch the Terminal and type the 'md5' command and point it at the file you wish to check the md5 has for.
sha1sum is a computer program that calculates and verifies SHA-1 hashes. It is commonly used to verify the integrity of files. It (or a variant) is installed by default on most Linux distributions.
You can install it in Mac OS using homebrew with brew install md5sha1sum
. Got the info from this link https://raamdev.com/2008/howto-install-md5sum-sha1sum-on-mac-os-x/
MacOS has shasum
preinstalled, which calculates sha1
sum by default:
$ shasum --help Usage: shasum [OPTION]... [FILE]... Print or check SHA checksums. With no FILE, or when FILE is -, read standard input. -a, --algorithm 1 (default), 224, 256, 384, 512, 512224, 512256 [...]
Usage example:
$ echo -n "test" | shasum a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 -
Also openssl sha1
does the job:
$ echo -n "test" | openssl sha1 a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With