From 04489c6c77e9c80e5b3332b81cea149dad1c7d88 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 3 Feb 2020 18:56:05 -0700 Subject: Add ability to show layout format! --- src/Internal/Hash.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/Internal/Hash.hs (limited to 'src/Internal/Hash.hs') diff --git a/src/Internal/Hash.hs b/src/Internal/Hash.hs new file mode 100644 index 0000000..63f6043 --- /dev/null +++ b/src/Internal/Hash.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE OverloadedStrings #-} +module Internal.Hash where + +import Numeric (showHex) +import qualified Data.ByteString as BS +import qualified Data.ByteString.Char8 as BC +import qualified Crypto.Hash.SHA1 as SHA1 + +quickHash :: String -> String +quickHash str = + concatMap (flip showHex "") $ BS.unpack (SHA1.hash $ BC.pack str) -- cgit