diff options
Diffstat (limited to 'Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs')
-rw-r--r-- | Codec/Encryption/OpenPGP/ASCIIArmor/Utils.hs | 7 |
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 | ||
6 | module Codec.Encryption.OpenPGP.ASCIIArmor.Utils ( | 6 | module Codec.Encryption.OpenPGP.ASCIIArmor.Utils ( |
7 | crlfUnlines | 7 | crlfUnlines |
8 | , crlfUnlinesLazy | ||
8 | ) where | 9 | ) where |
9 | 10 | ||
10 | import Data.ByteString (ByteString) | 11 | import Data.ByteString (ByteString) |
11 | import qualified Data.ByteString as B | 12 | import qualified Data.ByteString as B |
12 | import qualified Data.ByteString.Char8 as BC8 | 13 | import qualified Data.ByteString.Char8 as BC8 |
14 | import qualified Data.ByteString.Lazy as BL | ||
15 | import qualified Data.ByteString.Lazy.Char8 as BLC8 | ||
13 | import Data.List (intersperse) | 16 | import Data.List (intersperse) |
14 | 17 | ||
15 | crlfUnlines :: [ByteString] -> ByteString | 18 | crlfUnlines :: [ByteString] -> ByteString |
16 | crlfUnlines [] = B.empty | 19 | crlfUnlines [] = B.empty |
17 | crlfUnlines ss = B.concat $ intersperse (BC8.pack "\r\n") ss | 20 | crlfUnlines ss = B.concat $ intersperse (BC8.pack "\r\n") ss |
21 | |||
22 | crlfUnlinesLazy :: [BL.ByteString] -> BL.ByteString | ||
23 | crlfUnlinesLazy [] = BL.empty | ||
24 | crlfUnlinesLazy ss = BL.concat $ intersperse (BLC8.pack "\r\n") ss | ||