From 087f4d20923e822529f2a21673d434207f5ce9f5 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 22 Jul 2017 22:58:23 -0400 Subject: [PATCH] Convert yesod-static to cryptonite. --- stack.yaml | 1 + yesod-static/Yesod/Static.hs | 6 +++--- yesod-static/yesod-static.cabal | 10 ++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/stack.yaml b/stack.yaml index 57a79fa9..91401c44 100644 --- a/stack.yaml +++ b/stack.yaml @@ -24,6 +24,7 @@ extra-deps: - persistent-sqlite-2.5 - cookie-0.4.2 - cryptonite-0.23 +- cryptonite-conduit-0.2.0 - foundation-0.0.9 - memory-0.14.5 - hfsevents-0.1.6 diff --git a/yesod-static/Yesod/Static.hs b/yesod-static/Yesod/Static.hs index 4d8d368e..636bd333 100644 --- a/yesod-static/Yesod/Static.hs +++ b/yesod-static/Yesod/Static.hs @@ -81,7 +81,7 @@ import Crypto.Hash (MD5, Digest) import Control.Monad.Catch (MonadThrow) import Control.Monad.Trans.State -import qualified Data.Byteable as Byteable +import qualified Data.ByteArray as ByteArray import qualified Data.ByteString.Base64 import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Lazy as L @@ -420,7 +420,7 @@ mkStaticFilesList' fp fs makeHash = do base64md5File :: FilePath -> IO String base64md5File = fmap (base64 . encode) . hashFile - where encode d = Byteable.toBytes (d :: Digest MD5) + where encode d = ByteArray.convert (d :: Digest MD5) base64md5 :: L.ByteString -> String base64md5 lbs = @@ -428,7 +428,7 @@ base64md5 lbs = $ runIdentity $ sourceList (L.toChunks lbs) $$ sinkHash where - encode d = Byteable.toBytes (d :: Digest MD5) + encode d = ByteArray.convert (d :: Digest MD5) base64 :: S.ByteString -> String base64 = map tr diff --git a/yesod-static/yesod-static.cabal b/yesod-static/yesod-static.cabal index 9fe49537..ff266c0e 100644 --- a/yesod-static/yesod-static.cabal +++ b/yesod-static/yesod-static.cabal @@ -44,8 +44,9 @@ library , unix-compat >= 0.2 , conduit >= 0.5 , conduit-extra - , cryptohash-conduit >= 0.1 - , cryptohash >= 0.11 + , cryptonite-conduit >= 0.1 + , cryptonite >= 0.11 + , memory , data-default , mime-types >= 0.1 , hjsmin @@ -112,8 +113,9 @@ test-suite tests , http-types , unix-compat , conduit - , cryptohash-conduit - , cryptohash + , cryptonite-conduit + , cryptonite + , memory , data-default , mime-types , hjsmin