Openssl sha1 length

bash, linux, openssl

Solution

Why is the output of `openssl sha1 < /dev/null | wc --bytes` 50?

$ openssl sha1 < /dev/null
(stdin)= da39a3ee5e6b4b0d3255bfef95601890afd80709

Because the 20 byte digest is prefixed by `(stdin)=` and is expressed in hex.

Problem

Why after executing the command `openssl sha1 < /dev/null | wc --bytes` the output is 50? The output size of SHA-1 should have 160 bits what gives us 20 bytes.

Original source