gun/sea/base64.js
2019-11-29 11:42:47 +02:00

9 lines
331 B
JavaScript

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