Files
30-seconds-of-code/snippets/atob.md
2018-01-17 21:43:21 +02:00

328 B

atob

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

Create a Buffer for the given string with base-64 encoding and use Buffer.toString('binary') to return the decoded string.

const atob = str => new Buffer(str, 'base64').toString('binary');
atob('Zm9vYmFy'); // 'foobar'