Portability | unknown |
---|---|
Stability | experimental |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Safe Haskell | None |
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.
- sinkHash :: (Monad m, HashAlgorithm hash) => Consumer ByteString m (Digest hash)
- hashFile :: (MonadIO m, HashAlgorithm hash) => FilePath -> m (Digest hash)
Cryptographic hash functions
sinkHash :: (Monad m, HashAlgorithm hash) => Consumer ByteString m (Digest hash)Source
A Sink
that hashes a stream of ByteString
s
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
)