(function(e){functionr(r){returnnewe(t.createHash("sha256").update(r).digest("binary"),"binary")}functionn(e){returnr(r(e))}for(vart=require("crypto"),o=require("bignum"),i=newe(1024),c=newe(0),f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",u=f[0],a=newe(f,"ascii"),d={},h=0;h<f.length;h++)d[f[h]]=h;varl={encode:function(r){varn,t,c=o.fromBuffer(r);n=r.length<512?i:newe(r.length<<1);for(varf=n.length-1;c.gt(0);)t=c.mod(58),c=c.div(58),n[f]=a[t.toNumber()],f--;for(varu=0;0==r[u];)n[f]=a[0],u++,f--;returnn.slice(f+1,n.length).toString("ascii")},decode:function(r){if(0==r.length)returnc;for(varn=o(0),t=0;t<r.length;t++)n=n.mul(58),n=n.add(d[r[t]]);for(vart=0;t<r.length&&r[t]==u;)t++;if(t>0){vari=newe(t);returni.fill(0),t==r.length?i:(n=n.toBuffer(),e.concat([i,n],t+n.length))}returnn.toBuffer()}},s={encode:function(r){vart=newe(r.length+4),o=n(r);returnr.copy(t),o.copy(t,r.length),l.encode(t)},decode:function(e){varr=l.decode(e);if(r.length<4)thrownewError("invalid input: too short");vart=r.slice(0,-4),o=r.slice(-4),i=n(t),c=i.slice(0,4);if(o.toString()!=c.toString())thrownewError("checksum mismatch");returnt}};exports.setBuffer=function(e){i=e},exports.base58=l,exports.base58Check=s,exports.encode=l.encode,exports.decode=l.decode}).call(this,require("buffer").Buffer);
(function(e){functionr(r){returnnewe(t.createHash("sha256").update(r).digest("binary"),"binary")}functionn(e){returnr(r(e))}for(vart=require("crypto"),o=require("bignum"),i=newe(1024),c=newe(0),f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",u=f[0],a=newe(f,"ascii"),h={},d=0;d<f.length;d++)h[f[d]]=d;varl={encode:function(r){varn,t,c=o.fromBuffer(r);n=r.length<512?i:newe(r.length<<1);for(varf=n.length-1;c.gt(0);)t=c.mod(58),c=c.div(58),n[f]=a[t.toNumber()],f--;for(varu=0;0==r[u];)n[f]=a[0],u++,f--;returnn.slice(f+1,n.length).toString("ascii")},decode:function(r){if(0==r.length)returnc;for(varn=o(0),t=0;t<r.length;t++)n=n.mul(58),n=n.add(h[r[t]]);for(vart=0;t<r.length&&r[t]==u;)t++;if(t>0){vari=newe(t);returni.fill(0),t==r.length?i:(n=n.toBuffer(),e.concat([i,n],t+n.length))}returnn.toBuffer()}},s={encode:function(r){vart=newe(r.length+4),o=n(r);returnr.copy(t),o.copy(t,r.length),l.encode(t)},decode:function(e){varr=l.decode(e);if(r.length<4)thrownewError("invalid input: too short");vart=r.slice(0,-4),o=r.slice(-4),i=n(t),c=i.slice(0,4);if(o.toString("hex")!==c.toString("hex"))thrownewError("checksum mismatch");returnt}};exports.setBuffer=function(e){i=e},exports.base58=l,exports.base58Check=s,exports.encode=l.encode,exports.decode=l.decode}).call(this,require("buffer").Buffer);