aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Hash.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2020-02-03 18:56:05 -0700
committerJosh Rahm <rahm@google.com>2020-02-03 18:56:05 -0700
commit04489c6c77e9c80e5b3332b81cea149dad1c7d88 (patch)
tree55b661576f0bba5daabce53f1620861f2f8eae90 /src/Internal/Hash.hs
parente3b47c680b20aab1e703ce0525364244422c27e8 (diff)
downloadrde-04489c6c77e9c80e5b3332b81cea149dad1c7d88.tar.gz
rde-04489c6c77e9c80e5b3332b81cea149dad1c7d88.tar.bz2
rde-04489c6c77e9c80e5b3332b81cea149dad1c7d88.zip
Add ability to show layout format!
Diffstat (limited to 'src/Internal/Hash.hs')
-rw-r--r--src/Internal/Hash.hs11
1 files changed, 11 insertions, 0 deletions
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)