mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-20 16:01:55 +01:00
base16 encoding
This commit is contained in:
parent
60e1de61a2
commit
e278bc65ca
@ -6,7 +6,7 @@ import Crypto.Hash.Conduit (sinkHash)
|
|||||||
import Control.Monad.Catch (MonadCatch (..))
|
import Control.Monad.Catch (MonadCatch (..))
|
||||||
import Crypto.Hash (Digest, SHA1)
|
import Crypto.Hash (Digest, SHA1)
|
||||||
import Data.Byteable (toBytes)
|
import Data.Byteable (toBytes)
|
||||||
import qualified Data.ByteString.Base64.URL as B64
|
import qualified Data.ByteString.Base16 as B16
|
||||||
import Yesod.Core.Types (HandlerT (HandlerT), unHandlerT)
|
import Yesod.Core.Types (HandlerT (HandlerT), unHandlerT)
|
||||||
import Data.Conduit.Zlib (ungzip)
|
import Data.Conduit.Zlib (ungzip)
|
||||||
import qualified Codec.Archive.Tar as Tar
|
import qualified Codec.Archive.Tar as Tar
|
||||||
@ -38,7 +38,7 @@ putUploadStackageR = do
|
|||||||
$$ getZipSink (ZipSink sinkHash <* ZipSink (ungzip =$ sinkHandle handleOut))
|
$$ getZipSink (ZipSink sinkHash <* ZipSink (ungzip =$ sinkHandle handleOut))
|
||||||
liftIO $ hClose handleOut
|
liftIO $ hClose handleOut
|
||||||
let bs = toBytes (digest :: Digest SHA1)
|
let bs = toBytes (digest :: Digest SHA1)
|
||||||
ident = PackageSetIdent $ decodeUtf8 $ B64.encode bs
|
ident = PackageSetIdent $ decodeUtf8 $ B16.encode bs
|
||||||
|
|
||||||
-- Check for duplicates
|
-- Check for duplicates
|
||||||
mstackage <- runDB $ getBy $ UniqueStackage ident
|
mstackage <- runDB $ getBy $ UniqueStackage ident
|
||||||
|
|||||||
@ -101,7 +101,7 @@ library
|
|||||||
, exceptions
|
, exceptions
|
||||||
, byteable
|
, byteable
|
||||||
, cryptohash
|
, cryptohash
|
||||||
, base64-bytestring
|
, base16-bytestring
|
||||||
, zlib
|
, zlib
|
||||||
, esqueleto
|
, esqueleto
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user