Stability | experimental |
---|---|
Maintainer | Kevin Cantu <me@kevincantu.org> |
BLAKE is one of the finalists in the NIST SHA-3 hash function competition to replace SHA-1 and SHA-2.
- blake256 :: ByteString -> ByteString -> ByteString
- blake512 :: ByteString -> ByteString -> ByteString
- blake224 :: ByteString -> ByteString -> ByteString
- blake384 :: ByteString -> ByteString -> ByteString
- textDigest :: ByteString -> Text
Digests
:: ByteString | salt, 16 bytes |
-> ByteString | message |
-> ByteString | digest, 32 bytes |
Compute a BLAKE-256 digest from a given salt and message
:: ByteString | salt, 32 bytes |
-> ByteString | message |
-> ByteString | digest, 64 bytes |
Compute a BLAKE-512 digest from a given salt and message
:: ByteString | salt, 16 bytes |
-> ByteString | message |
-> ByteString | digest, 28 bytes |
Compute a BLAKE-224 digest from a given salt and message (trucates output of a BLAKE-256)
:: ByteString | salt, 32 bytes |
-> ByteString | message |
-> ByteString | digest, 48 bytes |
Compute a BLAKE-384 digest from a given salt and message (trucates output of a BLAKE-512)
Text output
textDigest :: ByteString -> TextSource
Convert a digest (or other ByteString) to hexadecimal digits
For example, to compute a digest of a message, `0x00`, using BLAKE-512 (faster on 64 bit systems), with a salt of 0, and get the digits in hex:
import Data.Digest.BLAKE import qualified Data.ByteString.Lazy as B textDigest $ blake512 (B.take 32 $ B.repeat 0) (B.singleton 0)