git ssb

1+

Dominic / ssb-private-groups



Tree: 128131cbfd2df26649597c787fbf851b2c81a79d

Files: 128131cbfd2df26649597c787fbf851b2c81a79d / util.js

551 bytesRaw
1
2exports.id2Buffer = function (id) {
3 return Buffer.from(id.substring(1, id.indexOf('.')), 'base64')
4}
5
6exports.isBox2 = function (ctxt) {
7 //we can just do a fairly lax check here, don't check the content
8 //is canonical base64, because that check has already been done.
9 return 'string' == typeof ctxt && /\.box2$/.test(ctxt)
10}
11
12exports.isCurvePair = function (keys) {
13 return keys.public && keys.private
14}
15
16exports.ctxt2Buffer = function (ctxt) {
17 return exports.isBox2(ctxt) && Buffer.from(ctxt.substring(0, ctxt.indexOf('.')), 'base64')
18}
19
20

Built with git-ssb-web