Intro

Installable via npm install --save peer-id, it can also be used directly in the browser.

Download

The source is available for download from GitHub. Alternatively, you can install using npm:

$ npm install --save peer-id

You can then require() peer-id as normal:

const peerId = require('peer-id')

In the Browser

peer-id should work in any ECMAScript 2018 environment out of the box.

Usage:

<script type="text/javascript" src="index.js"></script>

The portable versions of peer-id, including index.js and index.min.js, are included in the /dist folder. peer-id can also be found on unpkg.com under

Checks the equality of this peer against a given PeerId.

equals(id: (Buffer | PeerId)): boolean
Parameters
id ((Buffer | PeerId))
Returns
boolean:

Checks the equality of this peer against a given PeerId.

isEqual(id: (Buffer | PeerId)): boolean
Deprecated: Use .equals
Parameters
id ((Buffer | PeerId))
Returns
boolean: