GitXplorerGitXplorer
d

webrtc-explorer-peer-id

public
13 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
0161d3a677806e8cfaaa5cf77bc40c61bbf13477

Merge pull request #2 from raxo/patch-1

ddaviddias committed 8 years ago
Unverified
ec1490631fa624e3ffbd348dbaac2ed72b95e5a1

Prevent my eyes from bleeding

rraxo committed 8 years ago
Unverified
c6ac819bb7cb48782fafbb626300be070e6b1148

Release v1.1.0.

ddaviddias committed 9 years ago
Unverified
d1118722f95a24005a8553a0ac5e931453f6c77a

Merge pull request #1 from diasdavid/revamp

ddaviddias committed 9 years ago
Unverified
5282d81341cd03fd70b3cb15c46111254fbe6437

update readme

ddaviddias committed 9 years ago
Unverified
87773c5e51fcedfac27c87fe61c8f77846acf2cb

standard code style, mocha tests, removed unused methods

ddaviddias committed 9 years ago

README

The README file for this repository.

webrtc-explorer-peer-id

Peer Id generator and operator, designed with circular Id namespaces in mind, used in webrtc-explorer. Currently only supports 48 bits, but I'm happy to make accept PR that make it Id size agnostic.

Project Information

David Dias MSc in Peer-to-Peer Networks by Technical University of Lisbon

This work was developed by David Dias with supervision by Luís Veiga, all in INESC-ID Lisboa (Distributed Systems Group), Instituto Superior Técnico, Universidade de Lisboa, with the support of Fundação para a Ciência e Tecnologia.

More info on the team's work at:

If you use this project, please acknowledge it in your work by referencing the following document:

David Dias and Luís Veiga. browserCloud.js A federated community cloud served by a P2P overlay network on top of the web platform. INESC-ID Tec. Rep. 14/2015, Apr. 2015

Badgers

NPM Dependency Status Build Status

Properties

  • Uses sha1 to guarantee that ID's are generated with an uniform distribution
  • Runs in Node.js and in the browser
  • Respects the natural circular ID namespace DHT are known to use (meaning that there is no ID higher than 48 bits)

How to use

var Id = require('dht-id');

var idA = new Id(); // generates a new random Id with 48 bits length

var idB = new Id(<value to generate the Id from>); // generates an Id based on the value, same value always generates same Id

idA.toHex(); // returns the hex value of the Id in a string

idA.toDec(); // returns the dec value of the Id in a number

idA.next(); // basically this id + 1, useful to send to Sucessor

Id.hash(content); // convinient way to find the Id of a content and guarantee that it has our ideal id length