Convert yesod-static to cryptonite.
This commit is contained in:
parent
eb3c570c93
commit
087f4d2092
@ -24,6 +24,7 @@ extra-deps:
|
|||||||
- persistent-sqlite-2.5
|
- persistent-sqlite-2.5
|
||||||
- cookie-0.4.2
|
- cookie-0.4.2
|
||||||
- cryptonite-0.23
|
- cryptonite-0.23
|
||||||
|
- cryptonite-conduit-0.2.0
|
||||||
- foundation-0.0.9
|
- foundation-0.0.9
|
||||||
- memory-0.14.5
|
- memory-0.14.5
|
||||||
- hfsevents-0.1.6
|
- hfsevents-0.1.6
|
||||||
|
|||||||
@ -81,7 +81,7 @@ import Crypto.Hash (MD5, Digest)
|
|||||||
import Control.Monad.Catch (MonadThrow)
|
import Control.Monad.Catch (MonadThrow)
|
||||||
import Control.Monad.Trans.State
|
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.Base64
|
||||||
import qualified Data.ByteString.Char8 as S8
|
import qualified Data.ByteString.Char8 as S8
|
||||||
import qualified Data.ByteString.Lazy as L
|
import qualified Data.ByteString.Lazy as L
|
||||||
@ -420,7 +420,7 @@ mkStaticFilesList' fp fs makeHash = do
|
|||||||
|
|
||||||
base64md5File :: FilePath -> IO String
|
base64md5File :: FilePath -> IO String
|
||||||
base64md5File = fmap (base64 . encode) . hashFile
|
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 :: L.ByteString -> String
|
||||||
base64md5 lbs =
|
base64md5 lbs =
|
||||||
@ -428,7 +428,7 @@ base64md5 lbs =
|
|||||||
$ runIdentity
|
$ runIdentity
|
||||||
$ sourceList (L.toChunks lbs) $$ sinkHash
|
$ sourceList (L.toChunks lbs) $$ sinkHash
|
||||||
where
|
where
|
||||||
encode d = Byteable.toBytes (d :: Digest MD5)
|
encode d = ByteArray.convert (d :: Digest MD5)
|
||||||
|
|
||||||
base64 :: S.ByteString -> String
|
base64 :: S.ByteString -> String
|
||||||
base64 = map tr
|
base64 = map tr
|
||||||
|
|||||||
@ -44,8 +44,9 @@ library
|
|||||||
, unix-compat >= 0.2
|
, unix-compat >= 0.2
|
||||||
, conduit >= 0.5
|
, conduit >= 0.5
|
||||||
, conduit-extra
|
, conduit-extra
|
||||||
, cryptohash-conduit >= 0.1
|
, cryptonite-conduit >= 0.1
|
||||||
, cryptohash >= 0.11
|
, cryptonite >= 0.11
|
||||||
|
, memory
|
||||||
, data-default
|
, data-default
|
||||||
, mime-types >= 0.1
|
, mime-types >= 0.1
|
||||||
, hjsmin
|
, hjsmin
|
||||||
@ -112,8 +113,9 @@ test-suite tests
|
|||||||
, http-types
|
, http-types
|
||||||
, unix-compat
|
, unix-compat
|
||||||
, conduit
|
, conduit
|
||||||
, cryptohash-conduit
|
, cryptonite-conduit
|
||||||
, cryptohash
|
, cryptonite
|
||||||
|
, memory
|
||||||
, data-default
|
, data-default
|
||||||
, mime-types
|
, mime-types
|
||||||
, hjsmin
|
, hjsmin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user