BaseEncode

BaseEncode[ba]

encodes the byte array ba as a Base64 string.

Details

  • In BaseEncode[ba], ba should be a ByteArray object.
  • BaseEncode uses the default encoding scheme described in the internet standard recommendation RFC 4648.

Examples

open allclose all

Basic Examples  (1)

Encode a byte array:

Scope  (1)

Encode the bytes 1 through 12:

The bytes can be recovered using BaseDecode:

Properties & Relations  (6)

The string returned by BaseEncode[ba] has length divisible by 4:

Padding will be added, if necessary:

BaseEncode is the inverse of BaseDecode:

BaseEncode encodes binary data as a Base64 string:

The export format "Base64" encodes the string representation of an expression converted to bytes:

Achieve the same result with BaseEncode, ToString and ByteArrayToString:

BaseEncode converts a sequence of bytes to a sequence of characters:

IntegerString converts integers to a base-64 representation using the alphabet of Base64:

BaseEncode converts the "ByteArray" format of Hash to its "Base64Encoding" format:

ByteArray uses Base64 encoding of its data in InputForm:

Introduced in 2018
 (11.3)