package cryptokit

  1. Overview
  2. Docs

The Base64 module supports the encoding and decoding of binary data in base 64 format, using only alphanumeric characters that can safely be transmitted over e-mail or in URLs.

val encode_multiline : unit -> transform

Return a transform that performs base 64 encoding. The output is divided in lines of length 76 characters, and final = characters are used to pad the output, as specified in the MIME standard. The output is approximately 4/3 longer than the input.

val encode_compact : unit -> transform

Same as Cryptokit.Base64.encode_multiline, but the output is not split into lines, and no final padding is added. This is adequate for encoding short strings for transmission as part of URLs, for instance.

val encode_compact_pad : unit -> transform

Same as Cryptokit.Base64.encode_compact, but the output is padded with = characters at the end (if necessary).

val decode : unit -> transform

Return a transform that performs base 64 decoding. The input must consist of valid base 64 characters; blanks are ignored. Raise Error Bad_encoding if invalid base 64 characters are encountered in the input.