Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module exposes combinators to compute the SHA256 hash and the associated HMAC for some common types.
- data SHA256
- sha256 :: PureByteSource src => src -> SHA256
- sha256File :: FilePath -> IO SHA256
- sha256Source :: ByteSource src => src -> IO SHA256
- hmacSha256 :: PureByteSource src => Key (HMAC SHA256) -> src -> HMAC SHA256
- hmacSha256File :: Key (HMAC SHA256) -> FilePath -> IO (HMAC SHA256)
- hmacSha256Source :: ByteSource src => Key (HMAC SHA256) -> src -> IO (HMAC SHA256)
The SHA256 cryptographic hash
The Sha256 hash value.
sha256 :: PureByteSource src => src -> SHA256 Source #
Compute the sha256 hash of an instance of PureByteSource
. Use
this for computing the sha256 hash of a strict or lazy byte string.
sha256Source :: ByteSource src => src -> IO SHA256 Source #
Compute the sha256 hash of a general byte source.
HMAC computation using SHA256
:: PureByteSource src | |
=> Key (HMAC SHA256) | Key to use |
-> src | pure source whose hmac is to be computed |
-> HMAC SHA256 |
Compute the message authentication code using hmac-sha256.
Compute the message authentication code for a file.
hmacSha256Source :: ByteSource src => Key (HMAC SHA256) -> src -> IO (HMAC SHA256) Source #
Compute the message authetication code for a generic byte source.