cryptohash-conduit-0.1.1: cryptohash conduit

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone

Crypto.Hash.Conduit

Contents

Description

A module containing Conduit facilities for hash based functions.

this module is vaguely similar to the crypto-conduit part related to hash on purpose, as to provide an upgrade path. The api documentation is pulled directly from this package and adapted, and thus are originally copyright Felipe Lessa.

Synopsis

Cryptographic hash functions

sinkHash :: (Monad m, HashAlgorithm hash) => Consumer ByteString m (Digest hash)Source

A Sink that hashes a stream of ByteStrings and creates a digest d.

hashFile :: (MonadIO m, HashAlgorithm hash) => FilePath -> m (Digest hash)Source

Hashes the whole contents of the given file in constant memory. This function is just a convenient wrapper around sinkHash defined as:

 hashFile fp = liftIO $ runResourceT (sourceFile fp $$ sinkHash)