summaryrefslogtreecommitdiff
path: root/Backend
diff options
context:
space:
mode:
Diffstat (limited to 'Backend')
-rw-r--r--Backend/Hash.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Backend/Hash.hs b/Backend/Hash.hs
index 1175af0bd..fd89198d2 100644
--- a/Backend/Hash.hs
+++ b/Backend/Hash.hs
@@ -173,15 +173,16 @@ shaHasher hashsize filesize
| hashsize == 512 = use SysConfig.sha512 sha512
| otherwise = error $ "unsupported sha size " ++ show hashsize
where
- use Nothing hasher = Left $ show . hasher
+ use Nothing hasher = Left $ usehasher hasher
use (Just c) hasher
{- Use builtin, but slightly slower hashing for
- smallish files. Cryptohash benchmarks 90 to 101%
- faster than external hashers, depending on the hash
- and system. So there is no point forking an external
- process unless the file is large. -}
- | filesize < 1048576 = use Nothing hasher
- | otherwise = Right (c, show . hasher)
+ | filesize < 1048576 = Left $ usehasher hasher
+ | otherwise = Right (c, usehasher hasher)
+ usehasher hasher = show . hasher
skeinHasher :: HashSize -> (L.ByteString -> String)
skeinHasher hashsize