sha1_to_hex: properly terminate the SHA1