-
-
Notifications
You must be signed in to change notification settings - Fork 37.1k
btoa() and atob() #3462
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
All major browsers expose the
btoaandatobglobals for encoding ASCII strings as base64 and vice versa. It'd be beneficial for the "isomorphic" javascript topic if we'd provide these too:As for the implementation, we can't
Buffer('string').toString('base64')because that would encode unicode whileatobandbtoamust per spec throw on charcodes > 255. https://github.com/mathiasbynens/base64 looks like a solid implemenation we could pretty much drop in.