dataenc 0.12.1.0 → 0.13.0.0
raw patch · 5 files changed
+5/−101 lines, 5 filesdep ~base
Dependency ranges changed: base
Files
- DataencQC.hs +0/−10
- DataencUT.hs +0/−16
- dataenc.cabal +5/−5
- src/Codec/Binary/DataEncoding.hs +0/−14
- src/Codec/Binary/Hexadecimal.hs +0/−56
DataencQC.hs view
@@ -20,7 +20,6 @@ import qualified Codec.Binary.Base32Hex as Base32Hex import qualified Codec.Binary.Base16 as Base16 import qualified Codec.Binary.Yenc as Yenc-import qualified Codec.Binary.Hexadecimal as Hex import qualified Codec.Binary.QuotedPrintable as QP import qualified Codec.Binary.PythonString as Py import qualified Codec.Binary.Url as Url@@ -105,13 +104,6 @@ prop_yencChop n ws = ws == (Yenc.unchop $ Yenc.chop n ws) where types = (n::Int, ws :: [Word8]) --- {{{1 hexadecimal-prop_hexEncode ws = ws == (fromJust $ Hex.decode $ Hex.encode ws)- where types = ws :: [Word8]--prop_hexChop n s = s == (Hex.unchop $ Hex.chop n s)- where types = (n :: Int, s :: String)- -- {{{1 qp prop_qpEncode ws = ws == (fromJust $ QP.decode $ QP.encode ws) where types = ws :: [Word8]@@ -166,8 +158,6 @@ , testProperty "base16Chop" prop_base16Chop , testProperty "yencEncode" prop_yencEncode , testProperty "yencChop" prop_yencChop- , testProperty "hexEncode" prop_hexEncode- , testProperty "hexChop" prop_hexChop , testProperty "qpEncode" prop_qpEncode , testProperty "qpChop" prop_qpChop , testProperty "qpCombined" prop_qpCombined
DataencUT.hs view
@@ -214,20 +214,6 @@ , "yEnc chop" ~: [[0x3d, 0x40], [0x01, 0x3d, 0x4a]] ~=? Yenc.chop 2 [0x3d, 0x40, 0x01, 0x3d, 0x4a] ] --- {{{1 hexadecimal-hexTestData =- [ ("hex", "empty", "", [], hex)- , ("hex", "foobar", "666F6F626172", [102,111,111,98,97,114], hex)- ]-hexTests = buildTestList hexTestData--hexTestsFail = test- [ "hex decode short" ~: Nothing ~=? decode hex "0"- , "hex decode' short" ~: [Nothing] ~=? decode' hex "0"- , "hex decode illegal" ~: Nothing ~=? decode hex "H"- , "hex decode' illegal" ~: [Nothing] ~=? decode' hex "H"- ]- -- {{{1 quoted-printable qpTestData = [ ("qp", "empty", "", [], qp)@@ -294,8 +280,6 @@ , unitTest2TFTest base16Tests , unitTest2TFTest base16TestsFail , unitTest2TFTest yencTests- , unitTest2TFTest hexTests- , unitTest2TFTest hexTestsFail , unitTest2TFTest qpTests , unitTest2TFTest qpTestsSucc , unitTest2TFTest qpTestsFail
dataenc.cabal view
@@ -1,5 +1,5 @@ name: dataenc-version: 0.12.1.0+version: 0.13.0.0 license: BSD3 license-file: LICENSE cabal-version: >= 1.2@@ -10,13 +10,14 @@ copyright: Magnus Therning, 2007-2009 category: Codec synopsis: Data encoding library-description: Data encoding library currently providing Uuencode, Base64,- Base64Url, Base32, Base32Hex, Base16, Base85, and yEncoding.+description: Data encoding library currently providing Base16, Base32,+ Base32Hex, Base64, Base64Url, Base85, Python string escaping,+ Quoted-Printable, URL encoding, uuencode, xxencode, and yEncoding. extra-source-files: DataencUT.hs DataencQC.hs Test.hs GNUmakefile library hs-source-dirs: src- build-depends: array >= 0.2.0 && < 0.3, base >= 4.0.0 && < 4.1, containers >= 0.2.0 && < 0.3+ build-depends: array >= 0.2.0 && < 0.3, base >= 4.0.0 && < 4.2, containers >= 0.2.0 && < 0.3 exposed-modules: Codec.Binary.Base16 Codec.Binary.Base32@@ -25,7 +26,6 @@ Codec.Binary.Base64Url Codec.Binary.Base85 Codec.Binary.DataEncoding- Codec.Binary.Hexadecimal Codec.Binary.PythonString Codec.Binary.QuotedPrintable Codec.Binary.Url
src/Codec/Binary/DataEncoding.hs view
@@ -21,7 +21,6 @@ , decode , decode' , encode- , hex , py , qp , unchop@@ -42,7 +41,6 @@ import qualified Codec.Binary.Url as Url import qualified Codec.Binary.Uu as Uu import qualified Codec.Binary.Xx as Xx-import qualified Codec.Binary.Hexadecimal as Hex import qualified Codec.Binary.QuotedPrintable as QP import qualified Codec.Binary.PythonString as Py @@ -151,18 +149,6 @@ chop=Xx.chop, unchop=Xx.unchop }---- {{{1 hexadecimal--- | Hexadecimal, see "Codec.Binary.Hexadecimal" for more details on the--- individual functions.-hex :: DataCodec-hex = DataCodec- { encode = Hex.encode- , decode = Hex.decode- , decode' = Hex.decode'- , chop = Hex.chop- , unchop = Hex.unchop- } -- {{{1 quoted-printable -- | Quoted-printable, see "Codec.Binary.QuotedPrintable" for more details on
− src/Codec/Binary/Hexadecimal.hs
@@ -1,56 +0,0 @@--- |--- Module : Codec.Binary.Hexadecimal--- Copyright : (c) 2009 Magnus Therning--- License : BSD3------ Simple hexadecimal encoding.------ Further documentation and information can be found at--- <http://www.haskell.org/haskellwiki/Library/Data_encoding>.-module Codec.Binary.Hexadecimal- ( encode- , decode- , decode'- , chop- , unchop- ) where--import Data.Word--import Codec.Binary.Util---- {{{1 encode--- | Encode data. Each nibble of the byte is converted into one character in--- [0-9A-F].-encode :: [Word8]- -> String-encode [] = ""-encode (o:os) = toHex o ++ encode os---- {{{1 decode--- | Decode data (lazy).-decode' :: String- -> [Maybe Word8]-decode' "" = []-decode' (hn:ln:cs) = fromHex [hn, ln] : decode' cs-decode' _ = [Nothing]---- | Decode data (strict).-decode :: String -> Maybe [Word8]-decode = sequence . decode'---- {{{1 chop--- | Chop up a string in parts.-chop :: Int -- ^ length of individual lines- -> String- -> [String]-chop n "" = []-chop n s = let- enc_len | n < 2 = 2- | otherwise = n `div` 2 * 2- in (take enc_len s) : chop n (drop enc_len s)---- {{{1 unchop--- | Concatenate the list of strings into one long string.-unchop :: [String] -> String-unchop = foldr (++) ""