<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2007</year><year>2020</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>base64</title>
    <prepared>Ingela Anderton Andin</prepared>
    <docno></docno>
    <date>2007-02-22</date>
    <rev></rev>
    <file>base64.xml</file>
  </header>
  <module since="">base64</module>
  <modulesummary>Provides base64 encode and decode, see
    RFC 2045.</modulesummary>
  <description>
    <p>Provides base64 encode and decode, see
      <url href="https://www.ietf.org/rfc/rfc2045.txt">RFC 2045</url>.</p>
  </description>

  <datatypes>
    <datatype>
      <name name="ascii_string"/>
    </datatype>
    <datatype>
      <name name="ascii_binary"/>
      <desc><p>A <c>binary()</c> with ASCII characters in the range 1 to
        255.</p>
      </desc>
    </datatype>
  </datatypes>

  <funcs>
    <func>
      <name name="decode" arity="1" since=""/>
      <name name="decode_to_string" arity="1" since=""/>
      <name name="mime_decode" arity="1" since=""/>
      <name name="mime_decode_to_string" arity="1" since=""/>
      <fsummary>Decode a base64 encoded string to data.</fsummary>
      <type variable="Base64" name_i="1"/>
      <type variable="Data" name_i="1"/>
      <type variable="DataString" name_i="2"/>
      <desc>
        <p>Decodes a base64-encoded string to plain ASCII. See
          <url href="https://www.ietf.org/html/rfc4648">RFC 4648</url>.</p>
        <p><c>mime_decode/1</c> and <c>mime_decode_to_string/1</c> strip away
          illegal characters, while <c>decode/1</c> and
          <c>decode_to_string/1</c> only strip away whitespace characters.</p>
      </desc>
    </func>

    <func>
      <name name="encode" arity="1" since=""/>
      <name name="encode_to_string" arity="1" since=""/>
      <fsummary>Encode data into base64.</fsummary>
      <type variable="Data"/>
      <type variable="Base64" name_i="1"/>
      <type variable="Base64String"/>
      <desc>
        <p>Encodes a plain ASCII string into base64. The result is 33% larger
          than the data.</p>
      </desc>
    </func>
  </funcs>
</erlref>

