2016-12-02 14:57:37 +01:00
|
|
|
<!doctype html>
|
2019-11-04 19:15:17 +01:00
|
|
|
<html lang="en">
|
2019-07-23 14:38:29 +02:00
|
|
|
<head>
|
|
|
|
<meta charset='utf-8'>
|
2020-09-03 18:50:21 +02:00
|
|
|
<title>peer-id 0.14.1 | Documentation</title>
|
2019-07-23 14:38:29 +02:00
|
|
|
<meta name='description' content='IPFS Peer Id implementation in Node.js'>
|
|
|
|
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
|
|
<link href='assets/bass.css' rel='stylesheet'>
|
|
|
|
<link href='assets/style.css' rel='stylesheet'>
|
|
|
|
<link href='assets/github.css' rel='stylesheet'>
|
|
|
|
<link href='assets/split.css' rel='stylesheet'>
|
|
|
|
</head>
|
|
|
|
<body class='documentation m0'>
|
|
|
|
<div class='flex'>
|
|
|
|
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
|
|
|
|
<div class='py1 px2'>
|
|
|
|
<h3 class='mb0 no-anchor'>peer-id</h3>
|
2020-09-03 18:50:21 +02:00
|
|
|
<div class='mb1'><code>0.14.1</code></div>
|
2019-07-23 14:38:29 +02:00
|
|
|
<input
|
|
|
|
placeholder='Filter'
|
|
|
|
id='filter-input'
|
|
|
|
class='col12 block input'
|
2020-04-22 16:35:22 +02:00
|
|
|
spellcheck='false'
|
|
|
|
autocapitalize='off'
|
|
|
|
autocorrect='off'
|
2019-07-23 14:38:29 +02:00
|
|
|
type='text' />
|
|
|
|
<div id='toc'>
|
|
|
|
<ul class='list-reset h5 py1-ul'>
|
|
|
|
|
|
|
|
|
2019-11-12 15:06:26 +01:00
|
|
|
<li><a
|
|
|
|
href='#equals'
|
|
|
|
class="">
|
|
|
|
equals
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li><a
|
|
|
|
href='#isequal'
|
|
|
|
class="">
|
|
|
|
isEqual
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
2019-07-23 14:38:29 +02:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class='mt1 h6 quiet'>
|
|
|
|
<a href='https://documentation.js.org/reading-documentation.html'>Need help reading this?</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id='split-right' class='relative overflow-auto height-viewport-100'>
|
|
|
|
|
|
|
|
|
2019-11-12 15:06:26 +01:00
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='clearfix'>
|
|
|
|
|
|
|
|
<h3 class='fl m0' id='equals'>
|
|
|
|
equals
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
|
2020-09-03 18:50:21 +02:00
|
|
|
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/libp2p/js-peer-id/blob/ecc1e5be6dc702f8537ceb986116c69f2e800194/src/index.js#L150-L158'>
|
2019-11-12 15:06:26 +01:00
|
|
|
<span>src/index.js</span>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<p>Checks the equality of <code>this</code> peer against a given PeerId.</p>
|
|
|
|
|
2020-08-07 17:42:05 +02:00
|
|
|
<div class='pre p1 fill-light mt0'>equals(id: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</a> | PeerId)): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></div>
|
2019-11-12 15:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
|
|
<div class='prose'>
|
|
|
|
|
|
|
|
<div class='space-bottom0'>
|
|
|
|
<div>
|
2020-08-07 17:42:05 +02:00
|
|
|
<span class='code bold'>id</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</a> | PeerId))</code>
|
2019-11-12 15:06:26 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-22 16:35:22 +02:00
|
|
|
|
|
|
|
|
2019-11-12 15:06:26 +01:00
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='clearfix'>
|
|
|
|
|
|
|
|
<h3 class='fl m0' id='isequal'>
|
|
|
|
isEqual
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
|
2020-09-03 18:50:21 +02:00
|
|
|
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/libp2p/js-peer-id/blob/ecc1e5be6dc702f8537ceb986116c69f2e800194/src/index.js#L166-L168'>
|
2019-11-12 15:06:26 +01:00
|
|
|
<span>src/index.js</span>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<p>Checks the equality of <code>this</code> peer against a given PeerId.</p>
|
|
|
|
|
2020-08-07 17:42:05 +02:00
|
|
|
<div class='pre p1 fill-light mt0'>isEqual(id: (<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</a> | PeerId)): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></div>
|
2019-11-12 15:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div>Deprecated: Use
|
|
|
|
<code>.equals</code>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
|
|
<div class='prose'>
|
|
|
|
|
|
|
|
<div class='space-bottom0'>
|
|
|
|
<div>
|
2020-08-07 17:42:05 +02:00
|
|
|
<span class='code bold'>id</span> <code class='quiet'>((<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array">Uint8Array</a> | PeerId))</code>
|
2019-11-12 15:06:26 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
|
|
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-22 16:35:22 +02:00
|
|
|
|
|
|
|
|
2019-11-12 15:06:26 +01:00
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-23 14:38:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script src='assets/anchor.js'></script>
|
|
|
|
<script src='assets/split.js'></script>
|
|
|
|
<script src='assets/site.js'></script>
|
|
|
|
</body>
|
|
|
|
</html>
|