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

Safe HaskellNone




data Pair a b Source

Strict pairs.


Pair !a !b 

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

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.