Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/reklatsmasters/peerid

Generate peer id for bittorrent dht node
https://github.com/reklatsmasters/peerid

Last synced: 24 days ago
JSON representation

Generate peer id for bittorrent dht node

Awesome Lists containing this project

README

        

## peerid
[![travis](https://travis-ci.org/ReklatsMasters/peerid.svg)](https://travis-ci.org/ReklatsMasters/peerid)
[![npm](https://img.shields.io/npm/v/peerid.svg)](https://npmjs.org/package/peerid)
[![license](https://img.shields.io/npm/l/peerid.svg)](https://npmjs.org/package/peerid)
[![downloads](https://img.shields.io/npm/dm/peerid.svg)](https://npmjs.org/package/peerid)
[![Test Coverage](https://codeclimate.com/github/ReklatsMasters/peerid/badges/coverage.svg)](https://codeclimate.com/github/ReklatsMasters/peerid/coverage)

Generate peer id / node id for dht / bt node

### Usage

```js
const BtClient = require('bittorrent-tracker')
const peerid = require('peerid')

const client = new BtClient(peerid(), 6881 /*, torrent file */)
// do some ...

peerid('-UT1800-') // with prefix
```

### API

##### `peerid([prefix: String|Buffer]): Buffer`
Generate random peer id / node id

### License
MIT, © Dmitry Tsvettsikh