better name
This commit is contained in:
parent
547a18019f
commit
a3692b4ab2
1 changed files with 3 additions and 3 deletions
|
@ -129,15 +129,15 @@ hashFile hash file filesize = do
|
||||||
showAction "checksum"
|
showAction "checksum"
|
||||||
liftIO $ go hash
|
liftIO $ go hash
|
||||||
where
|
where
|
||||||
go (SHAHash hashsize) = case shaCommand hashsize filesize of
|
go (SHAHash hashsize) = case shaHasher hashsize filesize of
|
||||||
Left sha -> sha <$> L.readFile file
|
Left sha -> sha <$> L.readFile file
|
||||||
Right command ->
|
Right command ->
|
||||||
either error return
|
either error return
|
||||||
=<< externalSHA command hashsize file
|
=<< externalSHA command hashsize file
|
||||||
go (SkeinHash hashsize) = skeinHasher hashsize <$> L.readFile file
|
go (SkeinHash hashsize) = skeinHasher hashsize <$> L.readFile file
|
||||||
|
|
||||||
shaCommand :: HashSize -> Integer -> Either (L.ByteString -> String) String
|
shaHasher :: HashSize -> Integer -> Either (L.ByteString -> String) String
|
||||||
shaCommand hashsize filesize
|
shaHasher hashsize filesize
|
||||||
| hashsize == 1 = use SysConfig.sha1 sha1
|
| hashsize == 1 = use SysConfig.sha1 sha1
|
||||||
| hashsize == 256 = use SysConfig.sha256 sha256
|
| hashsize == 256 = use SysConfig.sha256 sha256
|
||||||
| hashsize == 224 = use SysConfig.sha224 sha224
|
| hashsize == 224 = use SysConfig.sha224 sha224
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue