Encode any value to base64 or Decode any value from base64 to String without external packages
const {job, value} = context.params;
if (job == 'encode') {
const btoa = (str) => Buffer.from(str, 'binary').toString('base64');
let encoded = btoa(value);
return encoded;
}
if (job == 'decode') {
const atob = (str) => Buffer.from(str, 'base64').toString('binary');
let decoded = atob(value);
return decoded;
}