Strings Toolkit - base64encode


Function File: Y = base64encode (X)
Function File: Y = base64encode (X, row_vector)

Convert X into string of printable characters according to RFC 2045.

The input may be a string or a matrix of integers in the range 0..255.

If want the output in the 1-row of strings format, pass the row_vector argument as true. Otherwise the output is a 4-row character matrix, which contains 4 encoded bytes in each column for each 3 bytes from the input.

Example:

 
 base64encode ('Hakuna Matata', true) 
   ⇒ SGFrdW5hIE1hdGF0YQ==
 
 

See also: base64decode, base64_encode.