React-native decoded base64 encoded string

atob and btoa are not supported in JavascriptCore but works when the app runs under Chrome debugger, because JS code runs in Chrome when debugged. There are many base64 modules. https://github.com/mathiasbynens/base64 works fine for me.


I find some simple way worked for me, the same api as node.

Install buffer

yarn add buffer

Usage:

console.log(Buffer.from("Hello World").toString('base64'));
console.log(Buffer.from("SGVsbG8gV29ybGQ=", 'base64').toString('ascii'));