Returns the digest of a value under a named algorithm.
one of DIGESTS: SHA-2, SHA-3 or BLAKE2, by node's name
the bytes, or a string read as UTF-8
hex, base64 or base64url for a string; a Buffer when absent
hex
base64
base64url
the digest: a string when an encoding is named, a Buffer when not
Error for an algorithm outside the list
Returns the digest of a value under a named algorithm.