euterpe% sha1 -s "abc"
SHA1 ("abc") = a9993e364706816aba3e25717850c26c9cd0d89d
euterpe% echo "abc" | sha1
03cfd743661f07975fa2f1220c5194cbaff48451
euterpe%
echo adds newline at the end.
% echo "abc" | wc -c
4
Use the -n switch to disable this, see echo(1).
% echo -n "abc" | sha1
a9993e364706816aba3e25717850c26c9cd0d89d
i assumed it was a newline thing. thanks for the -n switch tip!
i was also trying using stdin, but you have to press return and ^D, which always feeds sha1 a newline. :(
but `echo -n "string" | sha1` should work great.