J         ! " # $ % & ' ( ) * + , - . / 0 1 23456789:;<=>?@ABCDEFGHINone JKLMNOPQRSTUJKQRST JKLMNOPQRSTUNoneEncoding function. KThis function allocates enough space to hold 20% more than the size of the L indata (or at least 512 bytes) and then encodes as much as possible of the > indata. That means there is a risk that the encoded data won' t fit and in M that case the second part of the pair contains the remainder of the indata. +y_enc $ Data.ByteString.Char8.pack "foobar"("\144\153\153\140\139\156","")Msnd $ y_enc $ Data.ByteString.Char8.pack $ Data.List.take 257 $ repeat '\x13'"\DC3"Decoding function. 6y_dec $ Data.ByteString.pack [144,153,153,140,139,156]Right ("foobar","")'y_dec $ Data.ByteString.Char8.pack "=}"Right ("\DC3","")A Left> value is only ever returned on decoding errors which, due to 4 characteristics of the encoding, can never happen. &y_dec $ Data.ByteString.Char8.pack "="Right ("","=")Convenient function that calls " repeatedly until the whole input  data is encoded. A synonym for . VWXVWXNoneNoneEncoding function. 1xx_encode_part $ Data.ByteString.Char8.pack "foo" ("Naxj","")2xx_encode_part $ Data.ByteString.Char8.pack "foob" ("Naxj","b")'Encoding function for the final block. 0xx_encode_final $ Data.ByteString.Char8.pack "r" Just "QU"2xx_encode_final $ Data.ByteString.Char8.pack "foo"NothingDecoding function. 2xx_decode_part $ Data.ByteString.Char8.pack "Naxj"Right ("foo","")5xx_decode_part $ Data.ByteString.Char8.pack "NaxjMa3"Right ("foo","Ma3")2xx_decode_part $ Data.ByteString.Char8.pack "Na j"Left ("","Na J") 'Decoding function for the final block. 2xx_decode_final $ Data.ByteString.Char8.pack "Naw" Just "fo"/xx_decode_final $ Data.ByteString.Char8.pack ""Just ""2xx_decode_final $ Data.ByteString.Char8.pack "Na "Nothing;xx_decode_final $ encode $ Data.ByteString.Char8.pack "foo"Nothing YZ[\]   YZ[\] None    NoneEncoding function. FThis function encodes as large a portion of the input as possible and M returns the encoded part together with the remaining part. Enough space is N allocated for the encoding to make sure that the remaining part is less than / 3 bytes long, which means it can be passed to  as is. 1uu_encode_part $ Data.ByteString.Char8.pack "foo" ("9F]O","")2uu_encode_part $ Data.ByteString.Char8.pack "foob" ("9F]O","b")'Encoding function for the final block. 0The final block has to have a size less than 3. 0uu_encode_final $ Data.ByteString.Char8.pack "r" Just "<@"7Trying to pass in too large a block result in failure: 2uu_encode_final $ Data.ByteString.Char8.pack "foo"NothingDecoding function. DDecode as large a portion of the input as possible. Enough data is L allocated for the output to ensure that the remainder is less than 4 bytes  in size. Success result in a Right value: 2uu_decode_part $ Data.ByteString.Char8.pack "9F]O"Right ("foo","")5uu_decode_part $ Data.ByteString.Char8.pack "9F]O8F$"Right ("foo","8F$"),Failures occur on bad input and result in a Left value: 2uu_decode_part $ Data.ByteString.Char8.pack "9F 0"Left ("","9F 0")'Decoding function for the final block. .The final block has to have a size of 0 or 4: 3uu_decode_final $ Data.ByteString.Char8.pack "9F\\" Just "fo"/uu_decode_final $ Data.ByteString.Char8.pack ""Just ""2uu_decode_final $ Data.ByteString.Char8.pack "9F"NothingBBut it must be the encoding of a block that is less than 3 bytes: ;uu_decode_final $ encode $ Data.ByteString.Char8.pack "foo"Nothing#Convenience function that combines  and   to encode a complete string. )encode $ Data.ByteString.Char8.pack "foo""9F]O",encode $ Data.ByteString.Char8.pack "foobar" "9F]O8F%R"#Convenience function that combines  and   to decode a complete string. *decode $ Data.ByteString.Char8.pack "9F]O" Right "foo".decode $ Data.ByteString.Char8.pack "9F]O8F%R"Right "foobar"CFailures when decoding returns the decoded part and the remainder: .decode $ Data.ByteString.Char8.pack "9F]O8FR"Left ("foo","8F\172R") ^_`ab ^_`abNoneNoneEncoding function. JThis function allocates enough space to hold twice the size of the indata M (or at least 512 bytes) and then encodes as much as possible of the indata. 5 That means there is a risk that the encoded data won't fit and in that case C the second part of the pair contains the remainder of the indata. 'qp_enc $ Data.ByteString.Char8.pack "=" ("=3D","")Ksnd $ qp_enc $ Data.ByteString.Char8.pack $ Data.List.take 171 $ repeat '='"="Decoding function. ,qp_dec $ Data.ByteString.Char8.pack "foobar"Right "foobar"9qp_dec $ Data.ByteString.Char8.pack "1=20+=201=20=3D=202"Right "1 + 1 = 2"FThe input data is allowed to use lowercase letters in the hexadecimal L representation of an octets value, even though the standard says that only  uppercase letters may be used: )qp_dec $ Data.ByteString.Char8.pack "=3D" Right "=")qp_dec $ Data.ByteString.Char8.pack "=3d" Right "="CIt also allows the input to encode _all_ octets in the hexadecimal  representation: *qp_dec $ Data.ByteString.Char8.pack "=20!"Right (" !",""),qp_dec $ Data.ByteString.Char8.pack "=20=21"Right (" !","")A Left1 value is only ever returned on decoding errors. (qp_dec $ Data.ByteString.Char8.pack "=2"Right ("","=2"))qp_dec $ Data.ByteString.Char8.pack "=2g"Left ("","=2g")Convenient function that calls " repeatedly until the whole input  data is encoded. A synonym for . cdecdeNone NoneEncoding function. 3Encodes as large a part as possible of the indata. 5b85_encode_part $ Data.ByteString.Char8.pack "foobar"("AoDTs","ar")KIt supports special handling of both all-zero groups and all-space groups. 3b85_encode_part $ Data.ByteString.Char8.pack " " ("y", "")7b85_encode_part $ Data.ByteString.Char8.pack "\0\0\0\0" ("z", "")'Encoding function for the final block. 2b85_encode_final $ Data.ByteString.Char8.pack "ar" Just "@<)"Decoding function. 4Decode as large a portion of the input as possible. 4b85_decode_part $ Data.ByteString.Char8.pack "AoDTs"Right ("foob","")7b85_decode_part $ Data.ByteString.Char8.pack "AoDTs@<)"Right ("foob","@<)")2b85_decode_part $ Data.ByteString.Char8.pack "@<)"Right ("","@<)")KAt least 512 bytes of data is allocated for the output, but because of the K special handling of all-zero and all-space groups it is possible that the  space won'Bt be enough. (To be sure to always fit the output one would have M to allocate 5 times the length of the input. It seemed a good trade-off to > sometimes have to call the function more than once instead.) ]either snd snd $ b85_decode_part $ Data.ByteString.Char8.pack $ Prelude.take 129 $ repeat 'y'"y"'Decoding function for the final block. 3b85_decode_final $ Data.ByteString.Char8.pack "@<)" Just "ar"0b85_decode_final $ Data.ByteString.Char8.pack ""Just ""5b85_decode_final $ Data.ByteString.Char8.pack "AoDTs"Nothing #Convenience function that combines  and   to encode a complete string. +encode $ Data.ByteString.Char8.pack "foob""AoDTs"-encode $ Data.ByteString.Char8.pack "foobar" "AoDTs@<)"!#Convenience function that combines  and   to decode a complete string. ,decode $ Data.ByteString.Char8.pack "AoDTs""foob"/encode $ Data.ByteString.Char8.pack "AoDTs@<)""foobar" fghij ! ! ! fghij ! None"#"#"#"# None klmno$%&'()$%&'()$%&'() klmno$%&'() None*+*+*+*+ None,Encoding function. FThis function encodes as large a portion of the input as possible and M returns the encoded part together with the remaining part. Enough space is N allocated for the encoding to make sure that the remaining part is less than / 3 bytes long, which means it can be passed to - as is. 2b64_encode_part $ Data.ByteString.Char8.pack "foo" ("Zm9v","")3b64_encode_part $ Data.ByteString.Char8.pack "foob" ("Zm9v","b")-'Encoding function for the final block. 0The final block has to have a size less than 3. 1b64_encode_final $ Data.ByteString.Char8.pack "r" Just "cg=="7Trying to pass in too large a block result in failure: 3b64_encode_final $ Data.ByteString.Char8.pack "foo"Nothing.Decoding function. DDecode as large a portion of the input as possible. Enough data is L allocated for the output to ensure that the remainder is less than 4 bytes  in size. Success result in a Right value: 3b64_decode_part $ Data.ByteString.Char8.pack "Zm9v"Right ("foo","")7b64_decode_part $ Data.ByteString.Char8.pack "Zm9vYmE="Right ("foo","YmE="),Failures occur on bad input and result in a Left value: 3b64_decode_part $ Data.ByteString.Char8.pack "Z=9v"Left ("","Z=9v")/'Decoding function for the final block. .The final block has to have a size of 0 or 4: 4b64_decode_final $ Data.ByteString.Char8.pack "Zm8=" Just "fo"0b64_decode_final $ Data.ByteString.Char8.pack ""Just ""3b64_decode_final $ Data.ByteString.Char8.pack "Zm="NothingBBut it must be the encoding of a block that is less than 3 bytes: <b64_decode_final $ encode $ Data.ByteString.Char8.pack "foo"Nothing0#Convenience function that combines , and  - to encode a complete string. )encode $ Data.ByteString.Char8.pack "foo""Zm9v",encode $ Data.ByteString.Char8.pack "foobar" "Zm9vYmFy"1#Convenience function that combines . and  / to decode a complete string. *decode $ Data.ByteString.Char8.pack "Zm9v" Right "foo".decode $ Data.ByteString.Char8.pack "Zm9vYmFy"Right "foobar"CFailures when decoding returns the decoded part and the remainder: .decode $ Data.ByteString.Char8.pack "Zm9vYm=y"Left ("foo","Ym=y") pqrst,-./01,-./01,-./01 pqrst,-./01None23232323None4Encoding function. See . 5b32h_encode_part $ Data.ByteString.Char8.pack "fooba"("CPNMUOJ1","")6b32h_encode_part $ Data.ByteString.Char8.pack "foobar"("CPNMUOJ1","r")5'Encoding function for the final block. See . 2b32h_encode_final $ Data.ByteString.Char8.pack "r"Just "E8======"6b32h_encode_final $ Data.ByteString.Char8.pack "fooba"Nothing6Decoding function. See . 8b32h_decode_part $ Data.ByteString.Char8.pack "CPNMUOJ1"Right ("fooba","")@b32h_decode_part $ Data.ByteString.Char8.pack "CPNMUOJ1E8======"Right ("fooba","E8======")8b32h_decode_part $ Data.ByteString.Char8.pack "C=NMUOJ1"Left ("","C=NMUOJ1")7'Decoding function for the final block. See . 9b32h_decode_final $ Data.ByteString.Char8.pack "CPNMUOG=" Just "foob"1b32h_decode_final $ Data.ByteString.Char8.pack ""Just ""8b32h_decode_final $ Data.ByteString.Char8.pack "CPNMUO="Nothing?b32h_decode_final $ encode $ Data.ByteString.Char8.pack "fooba"Nothing8#Convenience function that combines 4 and  5 to encode a complete string. +encode $ Data.ByteString.Char8.pack "fooba" "CPNMUOJ1",encode $ Data.ByteString.Char8.pack "foobar""CPNMUOJ1E8======"9#Convenience function that combines 6 and  7 to decode a complete string. .decode $ Data.ByteString.Char8.pack "CPNMUOJ1" Right "fooba"6decode $ Data.ByteString.Char8.pack "CPNMUOJ1E8======"Right "foobar"CFailures when decoding returns the decoded part and the remainder: 6decode $ Data.ByteString.Char8.pack "CPNMUOJ1=8======"Left ("fooba","=8======") uvwxy456789456789456789 uvwxy456789None:;:;:;:;None<Encoding function. FThis function encodes as large a portion of the input as possible and M returns the encoded part together with the remaining part. Enough space is N allocated for the encoding to make sure that the remaining part is less than / 5 bytes long, which means it can be passed to = as is. 4b32_encode_part $ Data.ByteString.Char8.pack "fooba"("MZXW6YTB","")5b32_encode_part $ Data.ByteString.Char8.pack "foobar"("MZXW6YTB","r")='Encoding function for the final block. 0The final block has to have a size less than 5. 1b32_encode_final $ Data.ByteString.Char8.pack "r"Just "OI======"7Trying to pass in too large a block result in failure: 5b32_encode_final $ Data.ByteString.Char8.pack "fooba"Nothing>Decoding function. DDecode as large a portion of the input as possible. Enough data is L allocated for the output to ensure that the remainder is less than 8 bytes  in size. Success result in a Right value: 7b32_decode_part $ Data.ByteString.Char8.pack "MZXW6YTB"Right ("fooba","")?b32_decode_part $ Data.ByteString.Char8.pack "MZXW6YTBOI======"Right ("fooba","OI======"),Failures occur on bad input and result in a Left value: 7b32_decode_part $ Data.ByteString.Char8.pack "M=XW6YTB"Left ("","M=XW6YTB")?'Decoding function for the final block. .The final block has to have a size of 0 or 8: 8b32_decode_final $ Data.ByteString.Char8.pack "MZXW6YQ=" Just "foob"0b32_decode_final $ Data.ByteString.Char8.pack ""Just ""7b32_decode_final $ Data.ByteString.Char8.pack "MZXW6Y="NothingBBut it must be the encoding of a block that is less than 5 bytes: >b32_decode_final $ encode $ Data.ByteString.Char8.pack "fooba"Nothing@#Convenience function that combines < and  = to encode a complete string. +encode $ Data.ByteString.Char8.pack "fooba" "MZXW6YTB",encode $ Data.ByteString.Char8.pack "foobar""MZXW6YTBOI======"A#Convenience function that combines > and  ? to decode a complete string. .decode $ Data.ByteString.Char8.pack "MZXW6YTB" Right "fooba"6decode $ Data.ByteString.Char8.pack "MZXW6YTBOI======"Right "foobar"CFailures when decoding returns the decoded part and the remainder: 6decode $ Data.ByteString.Char8.pack "MZXW6YTBOI=0===="Left ("fooba","OI=0====") z{|}~<=>?@A<=>?@A<=>?@A z{|}~<=>?@ANoneBCBCBCBCNoneDEncoding function. KThis function, unlike some other encoding functions in the library, simply J cannot fail. Double the length of the input string is allocated for the 7 encoded data, which is guaranteed to hold the result. %b16_enc $ Data.ByteString.pack [0x00]"00"-b16_enc $ Data.ByteString.Char8.pack "foobar""666F6F626172"EDecoding function. !The returned value on success is Right (<decoded part>, < undecoded  part>)A (the undecoded part is either a empty or a single byte), and on  failure it's Left (< decoded part>, <undecodable part>). Space equal to K the length of the input string is allocated, which is more than enough to  hold the decoded data. )b16_dec $ Data.ByteString.Char8.pack "00"Right ("\NUL","")3b16_dec $ Data.ByteString.Char8.pack "666F6F626172"Right ("foobar","")2b16_dec $ Data.ByteString.Char8.pack "666F6F62617"Right ("fooba","7")3b16_dec $ Data.ByteString.Char8.pack "666F6F62617g"Left ("fooba","g")FA synonym for D. GA synonum for E. DThe encoded string EFGDEFGDEFGDEFGNoneHIHIHIHI !"#$%&' ( ) * +     , - . /     0 1 2 3  456789::;<=>?@ABCDEFGHIJKGLMNOGPQG R S T U G V W X Y G Z [ \ ] G^_`aGbcdeGfgGh sandi-0.2.3Codec.Binary.YencData.Conduit.Codec.YencCodec.Binary.XxData.Conduit.Codec.XxCodec.Binary.UuData.Conduit.Codec.UuCodec.Binary.QuotedPrintable"Data.Conduit.Codec.QuotedPrintableCodec.Binary.Base85Data.Conduit.Codec.Base85Codec.Binary.Base64UrlData.Conduit.Codec.Base64UrlCodec.Binary.Base64Data.Conduit.Codec.Base64Codec.Binary.Base32HexData.Conduit.Codec.Base32HexCodec.Binary.Base32Data.Conduit.Codec.Base32Codec.Binary.Base16Data.Conduit.Codec.Base16Data.Conduit.Codec.Utilb32_encode_partb32_encode_finalb32_decode_partb32_decode_finaly_ency_decencodedecodexx_encode_partxx_encode_finalxx_decode_partxx_decode_finaluu_encode_partuu_encode_finaluu_decode_partuu_decode_finalqp_encqp_decb85_encode_partb85_encode_finalb85_decode_partb85_decode_finalb64u_encode_partb64u_encode_finalb64u_decode_partb64u_decode_finalb64_encode_partb64_encode_finalb64_decode_partb64_decode_finalb32h_encode_partb32h_encode_finalb32h_decode_partb32h_decode_finalb16_encb16_decCodecDecodeException DecFuncFinalDecFunc EncFuncFinal EncFuncPartEncFuncencodeIdecodeIencodeIIdecodeII$fExceptionCodecDecodeExceptionc_y_decc_y_enccastEnumc_xx_dec_final c_xx_dec_partc_xx_enc_final c_xx_enc_partc_uu_dec_final c_uu_dec_partc_uu_enc_final c_uu_enc_partc_qp_decc_qp_encc_b85_dec_finalc_b85_dec_partc_b85_enc_finalc_b85_enc_partc_b64u_dec_finalc_b64u_dec_partc_b64u_enc_finalc_b64u_enc_partc_b64_dec_finalc_b64_dec_partc_b64_enc_finalc_b64_enc_partc_b32h_dec_finalc_b32h_dec_partc_b32h_enc_finalc_b32h_enc_partc_b32_dec_finalc_b32_dec_partc_b32_enc_finalc_b32_enc_part c_b16_dec c_b16_enc