diff options
Diffstat (limited to 'Backend/Hash.hs')
-rw-r--r-- | Backend/Hash.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Backend/Hash.hs b/Backend/Hash.hs index 309c0fe9f..d9a1bbc97 100644 --- a/Backend/Hash.hs +++ b/Backend/Hash.hs @@ -136,12 +136,6 @@ hashFile hash file filesize = do =<< externalSHA command hashsize file go (SkeinHash hashsize) = skeinHasher hashsize <$> L.readFile file -skeinHasher :: HashSize -> (L.ByteString -> String) -skeinHasher hashsize - | hashsize == 256 = show . skein256 - | hashsize == 512 = show . skein512 - | otherwise = error $ "bad skein size " ++ show hashsize - shaCommand :: HashSize -> Integer -> Either (L.ByteString -> String) String shaCommand hashsize filesize | hashsize == 1 = use SysConfig.sha1 sha1 @@ -160,3 +154,9 @@ shaCommand hashsize filesize - process unless the file is large. -} | filesize < 1048576 = use Nothing hasher | otherwise = Right c + +skeinHasher :: HashSize -> (L.ByteString -> String) +skeinHasher hashsize + | hashsize == 256 = show . skein256 + | hashsize == 512 = show . skein512 + | otherwise = error $ "bad skein size " ++ show hashsize |