sha-streams-0.2.0: SHA hashes for io-streams.

Safe HaskellNone
LanguageHaskell98

System.IO.Streams.SHA

Synopsis

Documentation

data Pair a b Source

Strict pairs.

Constructors

Pair !a !b 

uncurry' :: (a -> b -> c) -> Pair a b -> c Source

shaInput :: Decoder a -> (Decoder a -> Int -> Digest a) -> InputStream ByteString -> IO (InputStream ByteString, IO (Digest a)) Source

Inspired by countInput. The returned IO action can be run only when the input stream is exhausted, otherwise an error occurs.

checkedShaInput :: Decoder a -> (Decoder a -> Int -> Digest a) -> String -> InputStream ByteString -> IO (InputStream ByteString) Source

This returns an input stream exactly as the one being wrapped, but throws an error if the computed SHA hash does not match the one given.

modifyRef :: IORef a -> (a -> a) -> IO () Source

Taken from System.IO.Streams.ByteString.