diff options
Diffstat (limited to 'Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs')
-rw-r--r-- | Codec/Encryption/OpenPGP/ASCIIArmor/Encode.hs | 6 |
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 | |||
15 | import qualified Data.ByteString.Lazy.Char8 as BLC8 | 15 | import qualified Data.ByteString.Lazy.Char8 as BLC8 |
16 | import qualified Data.ByteString.Base64 as Base64 | 16 | import qualified Data.ByteString.Base64 as Base64 |
17 | import Data.Digest.CRC24 (crc24Lazy) | 17 | import Data.Digest.CRC24 (crc24Lazy) |
18 | import Data.Serialize.Put (runPutLazy, putWord32be) | 18 | import Data.Binary.Put (runPut, putWord32be) |
19 | 19 | ||
20 | encode :: [Armor] -> B.ByteString | 20 | encode :: [Armor] -> B.ByteString |
21 | encode = B.concat . BL.toChunks . encodeLazy | 21 | encode = 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 | ||
62 | armorChecksum :: ByteString -> ByteString | 62 | armorChecksum :: ByteString -> ByteString |
63 | armorChecksum = BLC8.cons '=' . armorData . BL.tail . runPutLazy . putWord32be . crc24Lazy | 63 | armorChecksum = BLC8.cons '=' . armorData . BL.tail . runPut . putWord32be . crc24Lazy |
64 | 64 | ||
65 | dashEscape :: ByteString -> ByteString | 65 | dashEscape :: ByteString -> ByteString |
66 | dashEscape = BLC8.unlines . map escapeLine . BLC8.lines | 66 | dashEscape = BLC8.unlines . map escapeLine . BLC8.lines |