Created
May 27, 2014 01:28
-
-
Save guipn/30711ed2748c9fef09a5 to your computer and use it in GitHub Desktop.
Calculate File Checksums
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.ByteString.Lazy as BL | |
import Data.Digest.Pure.MD5 | |
import Data.Digest.Pure.SHA | |
import System.Environment | |
main = do | |
args <- getArgs | |
content <- BL.readFile $ args !! 0 | |
putStrLn $ "SHA-1:\t\t" ++ (showDigest $ sha1 content) | |
putStrLn $ "SHA-256:\t" ++ (showDigest $ sha256 content) | |
putStrLn $ "MD5:\t\t" ++ (show $ md5 content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment