Codec.MIME.Base64

mime-0.4.0.2: Working with MIME types.

Copyright | (c) 2006-2009 Galois Inc.
License | BSD3
Maintainer | Sigbjorn Finne <sigbjorn.finne@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell98

Codec.MIME.Base64

Description

Base64 decoding and encoding routines, multiple entry points for either depending on use and level of control wanted over the encoded output (and its input form on the decoding side.)

Synopsis

- encodeRaw :: Bool -> [Word8] -> String
- encodeRawString :: Bool -> String -> String
- encodeRawPrim :: Bool -> Char -> Char -> [Word8] -> String
- formatOutput :: Int -> Maybe String -> String -> String
- decode :: String -> [Word8]
- decodeToString :: String -> String
- decodePrim :: Char -> Char -> String -> [Word8]

# Documentation

encodeRaw :: Bool -> [Word8] -> String #

encodeRawString :: Bool -> String -> String #

encodeRawPrim :: Bool -> Char -> Char -> [Word8] -> String #

`encodeRawPrim` lets you control what non-alphanum characters to use (The base64url variation uses `*` and `-`, for instance.) No support for mapping these to multiple characters in the output though.

formatOutput :: Int -> Maybe String -> String -> String #

`formatOutput n mbLT str` formats `str`, splitting it into lines of length `n`. The optional value lets you control what line terminator sequence to use; the default is CRLF (as per MIME.)

decode :: String -> [Word8] #

decodeToString :: String -> String #

decodePrim :: Char -> Char -> String -> [Word8] #