Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

ssb-sort

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssb-sort

sort ssb messages by cryptographic order

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
94
-44.38%
Maintainers
1
Weekly downloads
 
Created
Source

ssb-sort

sort a collection of messages by their causal order.

A hash can be interpreted as a link, (except it is what link, not a where link. Like cinderella's glass slipper, a hash lets you confirm when you have found a thing, but doesn't clue you in to where that thing is)

An interesting thing about hashes as links, is that they always point backwards in time. That is because you can't know the hash of something you've seen it, or seen evidence of it. You could make up a random hash - but then the chance that something with that hash will actually turn up is basically impossible.

This means that hashes represent causation, in some sense,

api

var sort = require('ssb-sort')

all functions will throw if there is a duplicate message in the input.

sort (set)

sort a set by causal order, sorts first by causal order, but if two messages are concurrent, breaks the tie by their received, then self-stated timestamps, then order by keys.

sort.heads (set)

returns the most recent keys in the set (furtherest down the causation chain)

sort.roots (set)

returns the earliest keys in the set, since this operates on an arbitary set of messages, there may be more than one root. but usually you'll select a set by getting messages that point to a particular root node, in which case this will return one key.

License

MIT

FAQs

Package last updated on 05 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts