[web-devel] [ANNOUNCE] First release of crypto-conduit
greg at gregweber.info
Sat Jan 7 11:06:54 CET 2012
I am wondering if you can provide even higher-level APIs for the common
hash <- runResourceT $ hashFile "my-file"
and possibly something that runs the ResourceT transformer:
hash <- runHashFile "my-file"
On Sat, Jan 7, 2012 at 12:16 AM, Felipe Almeida Lessa <
felipe.lessa at gmail.com> wrote:
> I'm pleased to announce the first release of crypto-conduit ! The
> crypto-api  package provides APIs for many cryptographic
> operations, such as cryptographic hashes and block ciphers. This new
> crypto-conduit package allows you to use many of these operations with
> conduits , giving you safe I/O using constant memory and no leaks.
> As an example, here's how you could get the SHA1 hash a file:
> import Crypto.Conduit -- from crypto-conduit
> import Crypto.Hash.SHA1 (SHA1) -- from cryptohash
> import Data.Conduit -- from conduit
> import Data.Conduit.Binary (sourceFile) -- from conduit
> main = do
> hash <- runResourceT $ sourceFile "my-file" $$ sinkHash
> print (hash :: SHA1)
> The code snippet above, despite having only "sourceFile ... $$
> sinkHash" on its core, guarantees that the file handle is not kept
> open and uses a constant amount of memory. Sweet!
> Please break this package! Although it comes with a test suite, it
> has just seen the light of the day.
> Cheers, =)
>  http://hackage.haskell.org/package/crypto-conduit
>  http://hackage.haskell.org/package/crypto-api
>  http://hackage.haskell.org/package/conduit
> web-devel mailing list
> web-devel at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the web-devel