Files
30-seconds-of-code/snippets/atob.md
Isabelle Viktoria Maciohsek 9acb7dadc1 Update formatting
2022-01-30 18:14:33 +02:00

446 B

title, tags, firstSeen, lastUpdated
title tags firstSeen lastUpdated
atob node,string,beginner 2018-01-17T21:43:21+02:00 2020-09-15T16:28:04+03:00

Decodes a string of data which has been encoded using base-64 encoding.

  • Create a Buffer for the given string with base-64 encoding.
  • Use Buffer.prototype.toString() to return the decoded string.
const atob = str => Buffer.from(str, 'base64').toString('binary');
atob('Zm9vYmFy'); // 'foobar'