Main Content

matlab.net.base64encode

Base 64 encoding of byte string or vector

Description

res = base64encode(V)encodesVusing base 64 encoding and returns the encoded characters as a string. For more information, seeRFC 4648 — Section 4, Base 64 Encoding. Base 64 encoding is used in some contexts in internet messages where data must be transmitted in a limited set of ASCII characters. Usebase64encodeto encode strings containing special characters that might be misinterpreted as control characters by the transmission protocol.base64encodecan encode arbitrary binary data.

IfVis a string or character vector,base64encodefirst converts it to bytes using the user default encoding. To use a different character encoding, call the MATLAB®unicode2nativefunction to convertVto auint8vector before passing it tobase64encode.

Input Arguments

collapse all

Data to encode, specified as a string, character vector, or numeric vector.

Introduced in R2016b