stop using MissingH for MD5
Cryptonite is faster and allocates less, and I want to get rid of MissingH use. Note that the new dependency on memory is free; it's a dependency of cryptonite. This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
44baa7b306
commit
6dd806f1ad
11 changed files with 98 additions and 30 deletions
|
@ -12,7 +12,6 @@ module Utility.FileSystemEncoding (
|
|||
useFileSystemEncoding,
|
||||
fileEncoding,
|
||||
withFilePath,
|
||||
md5FilePath,
|
||||
decodeBS,
|
||||
encodeBS,
|
||||
decodeW8,
|
||||
|
@ -27,7 +26,6 @@ import qualified GHC.IO.Encoding as Encoding
|
|||
import Foreign.C
|
||||
import System.IO
|
||||
import System.IO.Unsafe
|
||||
import qualified Data.Hash.MD5 as MD5
|
||||
import Data.Word
|
||||
import Data.Bits.Utils
|
||||
import Data.List
|
||||
|
@ -101,10 +99,6 @@ _encodeFilePath fp = unsafePerformIO $ do
|
|||
GHC.withCString enc fp (GHC.peekCString Encoding.char8)
|
||||
`catchNonAsync` (\_ -> return fp)
|
||||
|
||||
{- Encodes a FilePath into a Md5.Str, applying the filesystem encoding. -}
|
||||
md5FilePath :: FilePath -> MD5.Str
|
||||
md5FilePath = MD5.Str . _encodeFilePath
|
||||
|
||||
{- Decodes a ByteString into a FilePath, applying the filesystem encoding. -}
|
||||
decodeBS :: L.ByteString -> FilePath
|
||||
#ifndef mingw32_HOST_OS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue