Created
January 23, 2025 12:00
-
-
Save erickthered/8108520de5c9f8e69d1b30c53f1c6aec to your computer and use it in GitHub Desktop.
Equivalent functions of atob and atob for nodejs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const btoa = (text) => Buffer.from(text, 'binary').toString('base64'); | |
const atob = (base64) => Buffer.from(base64, 'base64').toString('binary'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment