507 B
507 B
title, tags, firstSeen, lastUpdated
| title | tags | firstSeen | lastUpdated |
|---|---|---|---|
| btoa | node,string,beginner | 2018-01-17T21:43:21+02:00 | 2020-09-15T16:28:04+03:00 |
Creates a base-64 encoded ASCII string from a String object in which each character in the string is treated as a byte of binary data.
- Create a
Bufferfor the given string with binary encoding and useBuffer.toString('base64')to return the encoded string.
const btoa = str => Buffer.from(str, 'binary').toString('base64');
btoa('foobar'); // 'Zm9vYmFy'