envelope-js
Advanced tools
Comparing version 0.0.2 to 0.1.0
19
index.js
const box = require('./box') | ||
const unbox = require('./unbox') | ||
const { unbox, unboxKey, unboxBody } = require('./unbox') | ||
const { DeriveSecret, slpEncode, Cipherlink } = require('./util') | ||
const CloakedMsgId = require('./cloaked-msg-id') | ||
const DeriveSecret = require('./util/derive-secret') | ||
const cipherlinks = require('./util/cipherlinks') | ||
module.exports = { | ||
box, | ||
...unbox, | ||
unbox, | ||
unboxKey, | ||
unboxBody, | ||
DeriveSecret, | ||
CloakedMsgId, | ||
...cipherlinks | ||
slp: { | ||
encode: slpEncode | ||
}, | ||
Cipherlink, | ||
CloakedMsgId | ||
} |
{ | ||
"name": "envelope-js", | ||
"description": "new private message format for ssb", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"homepage": "https://github.com/ssbc/envelope-js", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -42,2 +42,3 @@ # envelope-js | ||
NOTE: we also expose `unboxKey` and `unboxBody` for convenience. | ||
@@ -69,2 +70,9 @@ ### `DeriveSecret(feed_id, prev_msg_id) => derive` | ||
### `slp.encode(info) => Buffer` | ||
where `info` is an Array of Buffers. | ||
This is "short length-prefixed encoding", see https://github.com/ssbc/envelope-spec/blob/master/encoding/slp.md | ||
... | ||
@@ -71,0 +79,0 @@ |
const Derive = require('./derive-secret') | ||
const KeySlot = require('./key-slot') | ||
const slpEncode = require('./slp-encode') | ||
const cipherlinks = require('./cipherlinks') | ||
const Cipherlink = require('./cipherlink') | ||
const error = require('./error') | ||
@@ -11,4 +11,4 @@ | ||
slpEncode, | ||
...cipherlinks, | ||
Cipherlink, | ||
error | ||
} |
@@ -5,2 +5,4 @@ module.exports = function slpEncode (arr) { | ||
arr.forEach(el => { | ||
if (!Buffer.isBuffer(el)) throw new Error(`slp.encode expects Buffers, got ${el}`) | ||
const length = Buffer.alloc(2) | ||
@@ -7,0 +9,0 @@ length.writeInt16LE(el.length) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37256
1016
81