123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- var shim = require('./shim');
-
- var SEA = require('./root');
- SEA.work = require('./work');
- SEA.sign = require('./sign');
- SEA.verify = require('./verify');
- SEA.encrypt = require('./encrypt');
- SEA.decrypt = require('./decrypt');
- SEA.opt.aeskey = require('./aeskey');
- SEA.random = SEA.random || shim.random;
-
-
- SEA.Buffer = SEA.Buffer || require('./buffer');
-
-
-
-
-
-
- SEA.keyid = SEA.keyid || (async (pub) => {
- try {
-
- const pb = Buffer.concat(
- pub.replace(/-/g, '+').replace(/_/g, '/').split('.')
- .map((t) => Buffer.from(t, 'base64'))
- )
-
- const id = Buffer.concat([
- Buffer.from([0x99, pb.length / 0x100, pb.length % 0x100]), pb
- ])
- const sha1 = await sha1hash(id)
- const hash = Buffer.from(sha1, 'binary')
- return hash.toString('hex', hash.length - 8)
- } catch (e) {
- console.log(e)
- throw e
- }
- });
-
-
-
-
-
-
-
-
-
- var Gun = (SEA.window||{}).Gun || require((typeof MODULE == "undefined"?'.':'')+'./gun', 1);
- Gun.SEA = SEA;
- SEA.GUN = SEA.Gun = Gun;
- module.exports = SEA
-
|