diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-10-10 16:11:34 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-10-10 16:23:13 +0300 |
commit | c6239c19425b92724b09d7965e212a0ed856a609 (patch) | |
tree | 2185815c2b84744981fc6203408d9c17cd6e22c5 /src/Web/ZeroBin/Utils.hs | |
parent | 0e95d9d96e03d4fdc8d406235f1da8f9562241c8 (diff) | |
download | zerobin-c6239c19425b92724b09d7965e212a0ed856a609.tar.gz |
Use hindent
Diffstat (limited to 'src/Web/ZeroBin/Utils.hs')
-rw-r--r-- | src/Web/ZeroBin/Utils.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Web/ZeroBin/Utils.hs b/src/Web/ZeroBin/Utils.hs index 559d9ec..70068aa 100644 --- a/src/Web/ZeroBin/Utils.hs +++ b/src/Web/ZeroBin/Utils.hs @@ -1,11 +1,10 @@ {-| Various utility functions -} - -module Web.ZeroBin.Utils ( - toWeb -, makePassword -) where +module Web.ZeroBin.Utils + ( toWeb + , makePassword + ) where import Crypto.Random.Entropy (getEntropy) import Data.ByteString (ByteString) @@ -13,12 +12,13 @@ import Data.ByteString.Base64 (encode) import Data.ByteString.Char8 (unpack) -- | Encodes to base64 and drops padding '='. -toWeb :: ByteString -- ^ the data to encode - -> String -- ^ base64 string without padding +toWeb :: + ByteString -- ^ the data to encode + -> String -- ^ base64 string without padding toWeb = takeWhile (/= '=') . unpack . encode -- | Makes a random password -makePassword :: Int -- ^ the number of bytes of entropy - -> IO String -- ^ random byte-string encoded by 'toWeb' +makePassword :: + Int -- ^ the number of bytes of entropy + -> IO String -- ^ random byte-string encoded by 'toWeb' makePassword n = toWeb `fmap` getEntropy n - |