On macOS, shasum installed, which by default calculates the sum of sha1 :
$ 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:
$ "test" | shasum da39a3ee5e6b4b0d3255bfef95601890afd80709 -
Also openssl sha1 does the job:
$ "test" | openssl sha1 da39a3ee5e6b4b0d3255bfef95601890afd80709
source share