BLAKE2b is a cryptographic hash function (RFC 7693) that supports keyed hashing and variable-length output (1 to 64 bytes).
For fixed-length unkeyed hashes, prefer the dedicated modules
Blake2b224, Blake2b256, or
Blake2b512.
Create a digest from a String.
digestLength is the output length in bytes (1 to 64). Use empty Bytes
as key for unkeyed hashing, or a 1-to-64 byte key for a keyed hash (MAC).
import Blake2b
import Bytes.Encode as Encode
Blake2b.fromString
{ digestLength = 32, key = Encode.encode (Encode.sequence []) }
"hello"
|> Blake2b.toHex
--> "324dcf027dd4a30a932c441f365a25e86b173defa4b8e58948253471b81b72cf"Create a digest from a list of byte values (0-255).
Turn a digest into Bytes. Width matches the digestLength used at
construction time.
Turn a digest into a list of byte values (0-255).
An abstract BLAKE2b digest. Its length matches the
digestLengthpassed to the constructor.