[bench] add simple cryptohash vs cryptonite hash on file utility
This commit is contained in:
parent
09e83a7f68
commit
71cc250449
21
benchs/Hash.hs
Normal file
21
benchs/Hash.hs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{-# LANGUAGE PackageImports #-}
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
|
||||||
|
import System.Environment
|
||||||
|
import qualified Data.ByteString.Lazy as L
|
||||||
|
import "cryptonite" Crypto.Hash
|
||||||
|
import qualified "cryptohash" Crypto.Hash as Old
|
||||||
|
|
||||||
|
main = do
|
||||||
|
args <- getArgs
|
||||||
|
case args of
|
||||||
|
[] -> error "usage: bench <big-file>"
|
||||||
|
"old":x:_ -> do
|
||||||
|
r <- L.readFile x
|
||||||
|
let d = Old.hashlazy r :: Old.Digest Old.SHA1
|
||||||
|
putStrLn $ show d
|
||||||
|
x:_ -> do
|
||||||
|
r <- L.readFile x
|
||||||
|
let d = hashlazy r :: Digest SHA1
|
||||||
|
putStrLn $ show d
|
||||||
Loading…
Reference in New Issue
Block a user