module Crypto.Hash (
HashAlgorithm(..)
, SHA1
, SHA224
, SHA256
, SHA384
, SHA512
, MD5
, Whirlpool
, hash
, hashLazy
) where
import qualified Data.ByteString.Lazy as LBS
import Data.ByteString (ByteString)
import Crypto.Hash.ADT
import Crypto.Hash.SHA1
import Crypto.Hash.SHA256
import Crypto.Hash.SHA512
import Crypto.Hash.MD5
import Crypto.Hash.Whirlpool
hash :: (HashAlgorithm a) => ByteString -> a
hash :: forall a. HashAlgorithm a => ByteString -> a
hash = Context a -> a
forall a. HashAlgorithm a => Context a -> a
hashFinal (Context a -> a) -> (ByteString -> Context a) -> ByteString -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Context a -> ByteString -> Context a
forall a. HashAlgorithm a => Context a -> ByteString -> Context a
hashUpdate Context a
forall a. HashAlgorithm a => Context a
hashInit
hashLazy :: (HashAlgorithm a) => LBS.ByteString -> a
hashLazy :: forall a. HashAlgorithm a => ByteString -> a
hashLazy = Context a -> a
forall a. HashAlgorithm a => Context a -> a
hashFinal (Context a -> a) -> (ByteString -> Context a) -> ByteString -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Context a -> ByteString -> Context a)
-> Context a -> ByteString -> Context a
forall a. (a -> ByteString -> a) -> a -> ByteString -> a
LBS.foldlChunks Context a -> ByteString -> Context a
forall a. HashAlgorithm a => Context a -> ByteString -> Context a
hashUpdate Context a
forall a. HashAlgorithm a => Context a
hashInit