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:
Joey Hess 2017-05-15 18:10:13 -04:00
parent 44baa7b306
commit 6dd806f1ad
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
11 changed files with 98 additions and 30 deletions

View file

@ -25,6 +25,8 @@ import Utility.Path
import Utility.FileMode
import Utility.LockFile.LockStatus
import Utility.ThreadScheduler
import Utility.Hash
import Utility.FileSystemEncoding
import qualified Utility.LockFile.Posix as Posix
import System.IO
@ -33,7 +35,6 @@ import Data.Maybe
import Data.List
import Network.BSD
import System.FilePath
import Data.Hash.MD5
import Control.Applicative
import Prelude
@ -99,7 +100,9 @@ sideLockFile lockfile = do
f <- absPath lockfile
let base = intercalate "_" (splitDirectories (makeRelative "/" f))
let shortbase = reverse $ take 32 $ reverse base
let md5sum = if base == shortbase then "" else md5s (Str base)
let md5sum = if base == shortbase
then ""
else show (md5 (encodeBS base))
dir <- ifM (doesDirectoryExist "/dev/shm")
( return "/dev/shm"
, return "/tmp"