base64.js 337 B

123456789
  1. if(typeof btoa === "undefined"){
  2. if(typeof Buffer === "undefined") {
  3. global.Buffer = require("buffer").Buffer
  4. }
  5. global.btoa = function (data) { return Buffer.from(data, "binary").toString("base64"); };
  6. global.atob = function (data) { return Buffer.from(data, "base64").toString("binary"); };
  7. }