Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How to decode from a Base64 string in javascrip node?

thomaso34696569
Level 2
Level 2

How to decrypt a string that is Base64 in Javascript (Adobe camapign classic)

Ex: 
var Base64 = ''Qr1hU3Zdk/2m+k6UA+KpE="

1 Accepted Solution
Milan_Vucetic
Correct answer by
Community Advisor
Community Advisor

Hello @thomaso34696569 

try below red text.

 

var memBuff = new MemoryBuffer();
memBuff.fromString('dummy text');
var textBase64 = memBuff.toBase64();
logInfo(textBase64);

 

var memBuff2 = new MemoryBuffer();
memBuff2.appendBase64(textBase64);
var text = memBuff2.toString();
logInfo(text);

 

memBuff.dispose();
memBuff2.dispose();

View solution in original post

1 Reply
Milan_Vucetic
Correct answer by
Community Advisor
Community Advisor

Hello @thomaso34696569 

try below red text.

 

var memBuff = new MemoryBuffer();
memBuff.fromString('dummy text');
var textBase64 = memBuff.toBase64();
logInfo(textBase64);

 

var memBuff2 = new MemoryBuffer();
memBuff2.appendBase64(textBase64);
var text = memBuff2.toString();
logInfo(text);

 

memBuff.dispose();
memBuff2.dispose();

View solution in original post