Created
November 9, 2019 14:06
-
-
Save oelna/00c5ecc2fbf95196fca1f6ea13ef58d9 to your computer and use it in GitHub Desktop.
Ways to generate hashes on macOS (BSD)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shasum | |
## value of algorithm can be 1, 224, 256, 384, 512 | |
## hash of string | |
echo -n "foobar" | shasum -a 256 | |
## hash of file content | |
shasum -a 256 filename.ext | |
shasum --algorithm 256 /path/filename.ext | |
# openssl | |
## value of digest can be -md4, -md5, -ripemd160, -sha, -sha1, -sha224, -sha256, -sha384, -sha512, -whirlpool | |
## hash of string | |
echo -n "foobar" | openssl dgst -sha256 | |
## hash of file content | |
openssl dgst -sha256 /path/filename.ext |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment