summaryrefslogtreecommitdiff
path: root/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs')
-rw-r--r--Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
index c437439..fdb9961 100644
--- a/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
+++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs
@@ -1,5 +1,5 @@
1-- ASCIIArmor/Encode.hs: OpenPGP (RFC4880) ASCII armor implementation 1-- ASCIIArmor/Encode.hs: OpenPGP (RFC4880) ASCII armor implementation
2-- Copyright © 2012 Clint Adams 2-- Copyright © 2012-2018 Clint Adams
3-- This software is released under the terms of the ISC license. 3-- This software is released under the terms of the ISC license.
4-- (See the LICENSE file). 4-- (See the LICENSE file).
5 5
@@ -15,7 +15,7 @@ import qualified Data.ByteString.Lazy as BL
15import qualified Data.ByteString.Lazy.Char8 as BLC8 15import qualified Data.ByteString.Lazy.Char8 as BLC8
16import qualified Data.ByteString.Base64 as Base64 16import qualified Data.ByteString.Base64 as Base64
17import Data.Digest.CRC24 (crc24Lazy) 17import Data.Digest.CRC24 (crc24Lazy)
18import Data.Serialize.Put (runPutLazy, putWord32be) 18import Data.Binary.Put (runPut, putWord32be)
19 19
20encode :: [Armor] -> B.ByteString 20encode :: [Armor] -> B.ByteString
21encode = B.concat . BL.toChunks . encodeLazy 21encode = B.concat . BL.toChunks . encodeLazy
@@ -60,7 +60,7 @@ wordWrap lw bs
60 | otherwise = BL.take (fromIntegral lw) bs : wordWrap lw (BL.drop (fromIntegral lw) bs) 60 | otherwise = BL.take (fromIntegral lw) bs : wordWrap lw (BL.drop (fromIntegral lw) bs)
61 61
62armorChecksum :: ByteString -> ByteString 62armorChecksum :: ByteString -> ByteString
63armorChecksum = BLC8.cons '=' . armorData . BL.tail . runPutLazy . putWord32be . crc24Lazy 63armorChecksum = BLC8.cons '=' . armorData . BL.tail . runPut . putWord32be . crc24Lazy
64 64
65dashEscape :: ByteString -> ByteString 65dashEscape :: ByteString -> ByteString
66dashEscape = BLC8.unlines . map escapeLine . BLC8.lines 66dashEscape = BLC8.unlines . map escapeLine . BLC8.lines