Last active
January 29, 2022 03:01
-
-
Save konsumer/eff429df0278ac7ef5aacf1717059abe to your computer and use it in GitHub Desktop.
Node implementation for btoa/atob to do base64 like in the browser/cloudflare-worker.
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
if (typeof atob === 'undefined') { | |
var atob = a => new Buffer(a).toString('base64') | |
} | |
if (typeof btoa === 'undefined') { | |
var btoa = a => Buffer.from(a, 'base64').toString('utf8') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment