Table Of Contents

Previous topic

util

Next topic

util.BBox

This Page

util.Base64

Constructor

class util.Base64()

Methods

decode(value)
Arguments:
  • value (string) – a string or array of data to encode. It will use utf-8 encoding.
Throws Error:

if the parameter is invalid (empty or not a valid type).

Return type:

string

Decode a base 64 string. This assumes standard base 64 encoding, so no special decoding of escaped characters is performed.

decodeURL(value)
Arguments:
  • value (string) – a string or array of data to encode
Throws Error:

if the parameter is invalid (empty or not a valid type).

Returns:

base 64 encoded data

Return type:

string

Decode a base 64 string. This assumes standard base 64 encoding, so no special decoding of escaped characters is performed.

encode(value)
Arguments:
  • value (string|array) – a string or array of data to encode
Throws Error:

if the parameter is invalid (empty or not a valid type).

Returns:

base 64 encoded data

Return type:

string

Encode binary data as a Base64 string. This does not handle URL escaping, i.e. special characters such as ‘=’ may exist in the returned string.

encodeURL(value)
Arguments:
  • value (string) – a string or array of data to encode. It will use utf-8 encoding.
Throws Error:

if the parameter is invalid (empty or not a valid type).

Returns:

base 64 encoded data

Return type:

string

Encode binary data as a Base64 string. This version encodes for URLs, so special characters like ‘=’ are escaped.