base64

October 22, 2022

base64

Provides basic Base64 conversion functions.

$base64.encode(str, encoding = 'utf-8')

** [New in Pro 7.0.4open in new window] **

  • str {string} The string to encode
  • encoding {string} Optional, character encoding

Encodes the string str using Base64 and returns the encoded string.

console.log($base64.encode('test')); // print 'dGVzdA=='

$base64.decode(str, encoding = 'utf-8')

** [New in Pro 7.0.4open in new window] **

  • str {string} The string to decode
  • encoding {string} Optional, character encoding

Decodes the string str using Base64 and returns the decoded string.

console.log($base64.decode('dGVzdA==')); // print 'test'
Last update:
Contributors: Bruce