[bench] add simple cryptohash vs cryptonite hash on file utility

This commit is contained in:
Vincent Hanquez 2015-05-02 05:41:45 +01:00
parent 09e83a7f68
commit 71cc250449

21
benchs/Hash.hs Normal file
View 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