Skip to content

datasource.btoa ^v2.6.185

Converts a given byte array or string into a base64 encoded string. This function is made to mimic the functionality of javascripts btoa function.

js
datasource.btoa(value)
datasource.btoa(value)

Parameters

  • value (string or array): The byte array or string you want to encode.

Returns

  • string: A base64 encoded string representation of the provided value.

Examples

js
var encoded = datasource.btoa("Hello World");
// encoded would be SGVsbG8gV29ybGQ= in this example.
var encoded = datasource.btoa("Hello World");
// encoded would be SGVsbG8gV29ybGQ= in this example.