Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

envelope-js

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envelope-js - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

util/cipherlink.js

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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc