Skip to content

Instantly share code, notes, and snippets.

@oelna
Created Nov 9, 2019
Embed
What would you like to do?
Ways to generate hashes on macOS (BSD)
# 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