Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
BlueHost Web Hosting

Bonsai Boy of New York Bonsai Trees and Accessories

Website Domains Names & Hosting | Domain.com

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

DreamHost Web Hosting


Instant Grammar Checker - Correct all grammar errors and enhance your writing

Liquid Web Cloud VPS Hosting

Disclosure We are a professional Programming & Software Q&A website, that receives compensation from some of the links whose we show you with Information. It means that my content may contain affiliate links.

12,759 questions

17,366 answers

573 users

How to encode and decode from Base64 in Node.js

1 Answer

0 votes
const s = "Node.js Development";

// Encoding to Base64 
const s_utf8 = Buffer.from(s, "utf8");
const s_base64 = s_utf8.toString("base64");
console.log(s_base64);


// Decoding from Base64
const base64 = "Tm9kZS5qcyBEZXZlbG9wbWVudA==";
let buf = Buffer.from(base64, "base64");
const s1  = buf.toString("utf8");
console.log(s1);

  
/*
run:

Tm9kZS5qcyBEZXZlbG9wbWVudA==
Node.js Development

*/

 




answered Mar 19 by avibootz
...