nodejs btoa

82

nodejs btoa -

Buffer.from('Hello world!', 'binary').toString('base64')

atob nodejs -

(function () {
  "use strict";

  var atob = require('atob');
  var b64 = "SGVsbG8sIFdvcmxkIQ==";
  var bin = atob(b64);

  console.log(bin); // "Hello, World!"
}());

rror: btoa is not defined -

console.log(Buffer.from('Hello World!').toString('base64'));

Comments

Submit
0 Comments