gun/sea/base64.js
Mark Nadal 638c2c3c23 have unbuild function wrap to prevent scope leaks & allow RETURN hehehe so I can reject @bmatusiak 's lS change O:) O:) I love you you're a hero!
later with @bmatusiak check sea.then for '../gun.js' vs '../' vs ...
note: src/index -> core.js
TODO: something about WebRTC candidates hitting ack decrement limits?
2024-01-17 10:13:00 -08:00

12 lines
441 B
JavaScript

;(function(){
var u;
if(u+''== typeof btoa){
if(u+'' == typeof Buffer){
try{ global.Buffer = require("buffer", 1).Buffer }catch(e){ console.log("Please `npm install buffer` or add it to your package.json !") }
}
global.btoa = function(data){ return Buffer.from(data, "binary").toString("base64") };
global.atob = function(data){ return Buffer.from(data, "base64").toString("binary") };
}
}());