Skip to content

datasource.base64Bytes ^v2.6.185

Decodes a base64 encoded string and returns it as a byte array.

js
datasource.base64Bytes(base64)
datasource.base64Bytes(base64)

Parameters

  • base64 (string): The base64 encoded string you want to decode.

Returns

  • array: A byte array resulting from the decoding of the provided base64 string.

Examples

js
var myBase64String = "SGVsbG8gV29ybGQ="; // Hello World
var decodedBytes = datasource.base64Bytes(myBase64String);

// DecodedBytes would be a byte array of the following in this example.
// [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]
var myBase64String = "SGVsbG8gV29ybGQ="; // Hello World
var decodedBytes = datasource.base64Bytes(myBase64String);

// DecodedBytes would be a byte array of the following in this example.
// [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]