index.js 273 B

1234567891011121314151617
  1. (function () {
  2. "use strict";
  3. function btoa(str) {
  4. var buffer;
  5. if (str instanceof Buffer) {
  6. buffer = str;
  7. } else {
  8. buffer = Buffer.from(str.toString(), 'binary');
  9. }
  10. return buffer.toString('base64');
  11. }
  12. module.exports = btoa;
  13. }());