base64

Module

base64

Module summary

Implements base 64 encode and decode, see RFC2045.

Description

Implements base 64 encode and decode, see RFC2045.

Data types

ascii_string() = [1..255]

ascii_binary() = binary()

A binary() with ASCII characters in the range 1 to 255.

Exports

encode(Data) -> Base64encode_to_string(Data) -> Base64String

Types:

Data = ascii_string() | ascii_binary()
Base64 = ascii_binary()
Base64String = ascii_string()

Encodes a plain ASCII string into base64. The result will be 33% larger than the data.

decode(Base64) -> Datadecode_to_string(Base64) -> DataStringmime_decode(Base64) -> Datamime_decode_to_string(Base64) -> DataString

Types:

Base64 = ascii_string() | ascii_binary()
Data = ascii_binary()
DataString = ascii_string()

Decodes a base64 encoded string to plain ASCII. See RFC4648. mime_decode/1 and mime_decode_to_string/1 strips away illegal characters, while decode/1 and decode_to_string/1 only strips away whitespace characters.

© 2010–2017 Ericsson AB
Licensed under the Apache License, Version 2.0.