decrypt base64 code example
Example 1: buffer from base64
const b64string = /* whatever */;
const buf = Buffer.from(b64string, 'base64');
Example 2: base64
function getBase64(file:any) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}