gun/sea/base64.js
2020-05-01 19:13:13 -07:00

9 lines
337 B
JavaScript

if(typeof btoa === "undefined"){
if(typeof Buffer === "undefined") {
global.Buffer = require("buffer").Buffer
}
global.btoa = function (data) { return Buffer.from(data, "binary").toString("base64"); };
global.atob = function (data) { return Buffer.from(data, "base64").toString("binary"); };
}