diff --git a/yesod-static/Yesod/Static.hs b/yesod-static/Yesod/Static.hs index c817d4f0..e53459ab 100644 --- a/yesod-static/Yesod/Static.hs +++ b/yesod-static/Yesod/Static.hs @@ -57,7 +57,7 @@ import Data.List (intercalate) import Language.Haskell.TH import Language.Haskell.TH.Syntax -import Crypto.Conduit (sinkHash) +import Crypto.Conduit (hashFile) import Crypto.Hash.MD5 (MD5) import qualified Data.ByteString.Lazy as L @@ -314,9 +314,8 @@ mkStaticFilesList fp fs routeConName makeHash = do ] base64md5File :: Prelude.FilePath -> IO String -base64md5File file = do - hash <- C.runResourceT $ CB.sourceFile file C.$$ sinkHash - return $ base64 $ Data.Serialize.encode (hash :: MD5) +base64md5File = fmap (base64 . encode) . hashFile + where encode d = Data.Serialize.encode (d :: MD5) base64 :: MD5Digest -> String base64 = map tr diff --git a/yesod-static/yesod-static.cabal b/yesod-static/yesod-static.cabal index 644f8782..f83dd7f4 100644 --- a/yesod-static/yesod-static.cabal +++ b/yesod-static/yesod-static.cabal @@ -40,7 +40,7 @@ library , http-types >= 0.6.5 && < 0.7 , unix-compat >= 0.2 , conduit >= 0.0 - , crypto-conduit >= 0.1 && < 0.2 + , crypto-conduit >= 0.1.1 && < 0.2 , cryptohash >= 0.6.1 exposed-modules: Yesod.Static ghc-options: -Wall