aboutsummaryrefslogtreecommitdiff
path: root/Backend
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-05-15 18:10:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-05-15 21:36:03 -0400
commit973180b077e60b5d12d7c57d926878d11d7f2105 (patch)
tree7d3bc5e651d330c1945c81f356b59eca90e73ea2 /Backend
parent0d85a42333484e1acb8e4942a619087768bc62fb (diff)
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.
Diffstat (limited to 'Backend')
-rw-r--r--Backend/Utilities.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Backend/Utilities.hs b/Backend/Utilities.hs
index d1fb94f2a..1691fa2b2 100644
--- a/Backend/Utilities.hs
+++ b/Backend/Utilities.hs
@@ -7,10 +7,9 @@
module Backend.Utilities where
-import Data.Hash.MD5
-
import Annex.Common
import Utility.FileSystemEncoding
+import Utility.Hash
{- Generates a keyName from an input string. Takes care of sanitizing it.
- If it's not too long, the full string is used as the keyName.
@@ -20,7 +19,8 @@ genKeyName :: String -> String
genKeyName s
-- Avoid making keys longer than the length of a SHA256 checksum.
| bytelen > sha256len =
- truncateFilePath (sha256len - md5len - 1) s' ++ "-" ++ md5s (Str s)
+ truncateFilePath (sha256len - md5len - 1) s' ++ "-" ++
+ show (md5 (encodeBS s))
| otherwise = s'
where
s' = preSanitizeKeyName s