• Wincent
    Open
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search

atob and btoa in Node.jsEdit

Created 6/2/2016, updated 3/12/2020

Base-64 encode

new Buffer('Hello World!').toString('base64'); // SGVsbG8gV29ybGQh

Base-64 decode

new Buffer('SGVsbG8gV29ybGQh', 'base64').toString(); // Hello World!

Source

  • http://stackoverflow.com/questions/23097928/node-js-btoa-is-not-defined-error
  • javascript
  • wiki
Site
  • About
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search
External
  • GitHub
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
Colophon

Made by Greg Hurrell using React, Relay and GraphQL (with help from Git, Redis and Neovim).