on master help sign in
Merge pull request #234 from vincenthz/master

Replace crypto-conduit, crypto-api by simpler cryptohash and cryptohash-conduit

commitc138536c0e84d219bcf799c8caf054f8c143fcde authorMichael Snoyman <michael@snoyman.com> dateTue 18 Mar 2014, 09:48 (13 years ago) parentda96364dbc5857
3 files changed+11−12
wai-app-static/WaiAppStatic/Storage/Embedded/Runtime.hs+3−3 wai-app-static/WaiAppStatic/Storage/Filesystem.hs+5−5 wai-app-static/wai-app-static.cabal+3−4
wai-app-static/WaiAppStatic/Storage/Embedded/Runtime.hs+3−3
@@ -15,8 +15,8 @@ import Data.Function (on)
1515import qualified Data.Text as T
1616import Data.Ord
1717import qualified Data.ByteString as S
18−import qualified Crypto.Classes as CR
19−import Crypto.Hash.CryptoAPI (hash', MD5)
18+import Crypto.Hash (hash, MD5, Digest)
19+import Data.Byteable (toBytes)
2020import qualified Data.ByteString.Base64 as B64
2121import WaiAppStatic.Storage.Filesystem (defaultFileServerSettings)
2222import System.FilePath (isPathSeparator)
@@ -95,4 +95,4 @@ bsToFile name bs = File
9595 }
9696
9797runHash :: ByteString -> ByteString
98−runHash = B64.encode . CR.encode . (hash' :: S.ByteString -> MD5)
98+runHash = B64.encode . toBytes . (hash :: S.ByteString -> Digest MD5)
wai-app-static/WaiAppStatic/Storage/Filesystem.hs+5−5
@@ -25,9 +25,9 @@ import WaiAppStatic.Listing
2525import Network.Mime
2626import System.PosixCompat.Files (fileSize, getFileStatus, modificationTime, isRegularFile)
2727import Data.Maybe (catMaybes)
28−import qualified Crypto.Conduit
29−import Data.Serialize (encode)
30−import Crypto.Hash.CryptoAPI (MD5)
28+import qualified Crypto.Hash.Conduit (hashFile)
29+import Data.Byteable (toBytes)
30+import Crypto.Hash (MD5, Digest)
3131import qualified Data.ByteString.Base64 as B64
3232
3333-- | Construct a new path from a root and some @Pieces@.
@@ -117,8 +117,8 @@ webAppLookup hashFunc prefix pieces =
117117-- exists.
118118hashFile :: FilePath -> IO ByteString
119119hashFile fp = do
120− h <- Crypto.Conduit.hashFile (F.encodeString fp)
121− return $ B64.encode $ encode (h :: MD5)
120+ h <- Crypto.Hash.Conduit.hashFile (F.encodeString fp)
121+ return $ B64.encode $ toBytes (h :: Digest MD5)
122122
123123hashFileIfExists :: ETagLookup
124124hashFileIfExists fp = do
wai-app-static/wai-app-static.cabal+3−4
@@ -37,15 +37,14 @@ library
3737 , text >= 0.7
3838 , blaze-builder >= 0.2.1.4
3939 , base64-bytestring >= 0.1
40− , crypto-api >= 0.12.2
41− , cryptohash-cryptoapi >= 0.1.0
40+ , byteable
41+ , cryptohash >= 0.11
42+ , cryptohash-conduit >= 0.1.0
4243 , system-filepath >= 0.4
4344 , system-fileio >= 0.3
4445 , http-date
4546 , blaze-html >= 0.5
4647 , blaze-markup >= 0.5.1
47− , crypto-conduit >= 0.4
48− , cereal >= 0.3.5
4948 , mime-types >= 0.1 && < 0.2
5049 , unordered-containers >= 0.2
5150 , template-haskell >= 2.7