summaryrefslogtreecommitdiff
path: root/Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs')
-rw-r--r--Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs
index 014c8aa..dddecab 100644
--- a/Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs
+++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs
@@ -5,13 +5,20 @@
5 5
6module Codec.Encryption.OpenPGP.ASCIIArmor.Utils ( 6module Codec.Encryption.OpenPGP.ASCIIArmor.Utils (
7 crlfUnlines 7 crlfUnlines
8 , crlfUnlinesLazy
8) where 9) where
9 10
10import Data.ByteString (ByteString) 11import Data.ByteString (ByteString)
11import qualified Data.ByteString as B 12import qualified Data.ByteString as B
12import qualified Data.ByteString.Char8 as BC8 13import qualified Data.ByteString.Char8 as BC8
14import qualified Data.ByteString.Lazy as BL
15import qualified Data.ByteString.Lazy.Char8 as BLC8
13import Data.List (intersperse) 16import Data.List (intersperse)
14 17
15crlfUnlines :: [ByteString] -> ByteString 18crlfUnlines :: [ByteString] -> ByteString
16crlfUnlines [] = B.empty 19crlfUnlines [] = B.empty
17crlfUnlines ss = B.concat $ intersperse (BC8.pack "\r\n") ss 20crlfUnlines ss = B.concat $ intersperse (BC8.pack "\r\n") ss
21
22crlfUnlinesLazy :: [BL.ByteString] -> BL.ByteString
23crlfUnlinesLazy [] = BL.empty
24crlfUnlinesLazy ss = BL.concat $ intersperse (BLC8.pack "\r\n") ss