git ssb

1+

Dominic / ssb-private-groups



Tree: d62aabe95512e6a3e72bd54fe3021aa77a550401

Files: d62aabe95512e6a3e72bd54fe3021aa77a550401 / 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