Skip to content

Instantly share code, notes, and snippets.

@guipn
Created May 27, 2014 01:28
Show Gist options
  • Save guipn/30711ed2748c9fef09a5 to your computer and use it in GitHub Desktop.
Save guipn/30711ed2748c9fef09a5 to your computer and use it in GitHub Desktop.
Calculate File Checksums
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