mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-05-29 11:51:40 +00:00
Updates
This commit is contained in:
parent
75275cb847
commit
76f1428872
36
index.html
36
index.html
@ -66,11 +66,11 @@ the global namespace.</p>
|
|||||||
<pre class='hljs'><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/peer-id/dist/index.min.js"</span>></span><span class="undefined"></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
<pre class='hljs'><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/peer-id/dist/index.min.js"</span>></span><span class="undefined"></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
||||||
<span class="hljs-comment"><!-- OR --></span>
|
<span class="hljs-comment"><!-- OR --></span>
|
||||||
<span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/peer-id/dist/index.js"</span>></span><span class="undefined"></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></pre>
|
<span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://unpkg.com/peer-id/dist/index.js"</span>></span><span class="undefined"></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></pre>
|
||||||
</div></div><div style="margin-bottom:92px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="PeerId"></a>PeerId<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L24-L141" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h1><div><p>A Peer ID is the SHA-256
|
</div></div><div style="margin-bottom:92px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="PeerId"></a>PeerId<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L24-L141" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h1><div><p>A Peer ID is the SHA-256
|
||||||
<a href="https://github.com/multiformats/multihash">multihash</a> of a
|
<a href="https://github.com/multiformats/multihash">multihash</a> of a
|
||||||
public key.</p>
|
public key.</p>
|
||||||
</div><div style="display:inline;" data-radium="true"><h4>See</h4><ul data-radium="true"><li><div><p><a href="htttps://github.com/libp2p/js-libp2p-crypto">libp2p-crypto</a></p>
|
</div><div style="display:inline;" data-radium="true"><h4>See</h4><ul data-radium="true"><li><div><p><a href="htttps://github.com/libp2p/js-libp2p-crypto">libp2p-crypto</a></p>
|
||||||
</div></li></ul></div><div data-radium="true"><h2 style="text-transform:uppercase;" data-radium="true">static</h2><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.create"></a>PeerId.create<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L161-L181" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>create(opts: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?, callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>))</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Create a new <code>PeerId</code> by generating a new public/private keypair.</p>
|
</div></li></ul></div><div data-radium="true"><h2 style="text-transform:uppercase;" data-radium="true">static</h2><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.create"></a>PeerId.create<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L161-L181" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>create(opts: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?, callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>))</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Create a new <code>PeerId</code> by generating a new public/private keypair.</p>
|
||||||
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>opts: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?</code></td><td>Configuration object.
|
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>opts: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?</code></td><td>Configuration object.
|
||||||
</td></tr><tr data-radium="true"><td><code>opts.bits: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>? (=2048)</code></td><td>How many bits to use for the RSA key generation.
|
</td></tr><tr data-radium="true"><td><code>opts.bits: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>? (=2048)</code></td><td>How many bits to use for the RSA key generation.
|
||||||
</td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>)</code></td><td>Node.js style callback.
|
</td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>)</code></td><td>Node.js style callback.
|
||||||
@ -81,44 +81,44 @@ PeerId.create(<span class="hljs-function">(<span class="hljs-params">err, id</sp
|
|||||||
<span class="hljs-keyword">throw</span> err
|
<span class="hljs-keyword">throw</span> err
|
||||||
}
|
}
|
||||||
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">'id'</span>, <span class="hljs-built_in">JSON</span>.stringify(id))
|
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">'id'</span>, <span class="hljs-built_in">JSON</span>.stringify(id))
|
||||||
})</code></pre></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromHexString"></a>PeerId.createFromHexString<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L189-L191" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromHexString(str: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="#peerid">PeerId</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from hex string representing the key's multihash.</p>
|
})</code></pre></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromHexString"></a>PeerId.createFromHexString<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L189-L191" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromHexString(str: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="#peerid">PeerId</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from hex string representing the key's multihash.</p>
|
||||||
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>str: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></td><td>Hex encoded id
|
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>str: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></td><td>Hex encoded id
|
||||||
</td></tr></div></tbody></table></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peerid">PeerId</a></code><span>
|
</td></tr></div></tbody></table></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peerid">PeerId</a></code><span>
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromBytes"></a>PeerId.createFromBytes<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L199-L201" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromBytes(buf: <a href="https://nodejs.org/api/buffer.html">Buffer</a>): <a href="#peerid">PeerId</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from a buffer representing the key's multihash.</p>
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromBytes"></a>PeerId.createFromBytes<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L199-L201" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromBytes(buf: <a href="https://nodejs.org/api/buffer.html">Buffer</a>): <a href="#peerid">PeerId</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from a buffer representing the key's multihash.</p>
|
||||||
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>buf: <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></td><td></td></tr></div></tbody></table></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peerid">PeerId</a></code><span>
|
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>buf: <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></td><td></td></tr></div></tbody></table></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peerid">PeerId</a></code><span>
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromB58String"></a>PeerId.createFromB58String<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L210-L212" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromB58String(str: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="#peerid">PeerId</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from a <code>base58</code> string representing the
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromB58String"></a>PeerId.createFromB58String<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L210-L212" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromB58String(str: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="#peerid">PeerId</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from a <code>base58</code> string representing the
|
||||||
key's multihash.</p>
|
key's multihash.</p>
|
||||||
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>str: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></td><td><code>base58</code>
|
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>str: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></td><td><code>base58</code>
|
||||||
encoded id
|
encoded id
|
||||||
</td></tr></div></tbody></table></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peerid">PeerId</a></code><span>
|
</td></tr></div></tbody></table></div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peerid">PeerId</a></code><span>
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromPubKey"></a>PeerId.createFromPubKey<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L220-L238" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromPubKey(key: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://nodejs.org/api/buffer.html">Buffer</a>), callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>))</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from a buffer containing a public key.</p>
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromPubKey"></a>PeerId.createFromPubKey<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L220-L238" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromPubKey(key: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://nodejs.org/api/buffer.html">Buffer</a>), callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>))</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from a buffer containing a public key.</p>
|
||||||
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>key: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://nodejs.org/api/buffer.html">Buffer</a>)</code></td><td></td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>)</code></td><td></td></tr></div></tbody></table></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromPrivKey"></a>PeerId.createFromPrivKey<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L247-L269" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromPrivKey(key: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://nodejs.org/api/buffer.html">Buffer</a>), callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>))</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from a buffer containing a private key.</p>
|
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>key: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://nodejs.org/api/buffer.html">Buffer</a>)</code></td><td></td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>)</code></td><td></td></tr></div></tbody></table></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromPrivKey"></a>PeerId.createFromPrivKey<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L247-L269" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromPrivKey(key: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://nodejs.org/api/buffer.html">Buffer</a>), callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>))</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Creates a Peer ID from a buffer containing a private key.</p>
|
||||||
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>key: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://nodejs.org/api/buffer.html">Buffer</a>)</code></td><td>The private key, if passed as
|
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>key: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://nodejs.org/api/buffer.html">Buffer</a>)</code></td><td>The private key, if passed as
|
||||||
string
|
string
|
||||||
<code>base64</code>
|
<code>base64</code>
|
||||||
encoding is assumed.
|
encoding is assumed.
|
||||||
</td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>)</code></td><td></td></tr></div></tbody></table></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromJSON"></a>PeerId.createFromJSON<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L277-L320" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromJSON(obj: <a href="#peeridjson">PeerIdJson</a>, callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>))</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Import a <code>PeerId</code> from a serialized JSON object.</p>
|
</td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>)</code></td><td></td></tr></div></tbody></table></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId.createFromJSON"></a>PeerId.createFromJSON<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L277-L320" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>createFromJSON(obj: <a href="#peeridjson">PeerIdJson</a>, callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>))</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Import a <code>PeerId</code> from a serialized JSON object.</p>
|
||||||
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>obj: <a href="#peeridjson">PeerIdJson</a></code></td><td></td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>)</code></td><td></td></tr></div></tbody></table></div></div></div><div data-radium="true"><h2 style="text-transform:uppercase;" data-radium="true">instance</h2><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#constructor"></a>PeerId.constructor<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L30-L43" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>constructor(id: <a href="https://nodejs.org/api/buffer.html">Buffer</a>, privKey: RSAPrivateKey?, pubKey: RSAPublickKey?)</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"></div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>id: <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></td><td></td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>privKey: RSAPrivateKey?</code></td><td></td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>pubKey: RSAPublickKey?</code></td><td></td></tr></div></tbody></table></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#id"></a>PeerId.id<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L40-L40" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>id: <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#privKey"></a>PeerId.privKey<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L50-L52" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>privKey: (RSAPrivateKey | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a>)</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>The private key of this id, if it exists.</p>
|
</div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>obj: <a href="#peeridjson">PeerIdJson</a></code></td><td></td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>callback: function (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="#peerid">PeerId</a>)</code></td><td></td></tr></div></tbody></table></div></div></div><div data-radium="true"><h2 style="text-transform:uppercase;" data-radium="true">instance</h2><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#constructor"></a>PeerId.constructor<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L30-L43" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>constructor(id: <a href="https://nodejs.org/api/buffer.html">Buffer</a>, privKey: RSAPrivateKey?, pubKey: RSAPublickKey?)</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"></div><div data-radium="true"><h4>Parameters</h4><table data-radium="true"><thead data-radium="true"><tr data-radium="true"><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Name</th><th style="text-align:left;font-family:Roboto, sans-serif;" data-radium="true">Description</th></tr></thead><tbody data-radium="true"><div data-radium="true"><tr data-radium="true"><td><code>id: <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></td><td></td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>privKey: RSAPrivateKey?</code></td><td></td></tr></div><div data-radium="true"><tr data-radium="true"><td><code>pubKey: RSAPublickKey?</code></td><td></td></tr></div></tbody></table></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#id"></a>PeerId.id<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L40-L40" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>id: <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#privKey"></a>PeerId.privKey<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L50-L52" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>privKey: (RSAPrivateKey | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a>)</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>The private key of this id, if it exists.</p>
|
||||||
</div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#pubKey"></a>PeerId.pubKey<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L59-L67" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>pubKey: (RSAPublicKey | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a>)</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>The private key of this id, if it exists.</p>
|
</div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#pubKey"></a>PeerId.pubKey<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L59-L67" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>pubKey: (RSAPublicKey | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a>)</code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>The private key of this id, if it exists.</p>
|
||||||
</div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#marshalPubKey"></a>PeerId.marshalPubKey<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L75-L79" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>marshalPubKey(): <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Create the protobuf version of the public key,
|
</div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#marshalPubKey"></a>PeerId.marshalPubKey<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L75-L79" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>marshalPubKey(): <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Create the protobuf version of the public key,
|
||||||
matching go-ipfs formatting.</p>
|
matching go-ipfs formatting.</p>
|
||||||
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://nodejs.org/api/buffer.html">Buffer</a></code><span> The marshalled public key
|
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://nodejs.org/api/buffer.html">Buffer</a></code><span> The marshalled public key
|
||||||
</span></div></div><div data-radium="true"><h4>Throws</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></code><span> Failure
|
</span></div></div><div data-radium="true"><h4>Throws</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></code><span> Failure
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#marshalPrivKey"></a>PeerId.marshalPrivKey<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L86-L90" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>marshalPrivKey(): <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Create the protobuf version of the private key,
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#marshalPrivKey"></a>PeerId.marshalPrivKey<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L86-L90" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>marshalPrivKey(): <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Create the protobuf version of the private key,
|
||||||
matching go-ipfs formatting.</p>
|
matching go-ipfs formatting.</p>
|
||||||
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://nodejs.org/api/buffer.html">Buffer</a></code><span>
|
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://nodejs.org/api/buffer.html">Buffer</a></code><span>
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toPrint"></a>PeerId.toPrint<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L97-L99" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toPrint(): <a href="#peeridjson">PeerIdJson</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Alias for <code>toJSON</code>.</p>
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toPrint"></a>PeerId.toPrint<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L97-L99" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toPrint(): <a href="#peeridjson">PeerIdJson</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Alias for <code>toJSON</code>.</p>
|
||||||
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peeridjson">PeerIdJson</a></code><span>
|
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peeridjson">PeerIdJson</a></code><span>
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toJSON"></a>PeerId.toJSON<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L107-L113" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toJSON(): <a href="#peeridjson">PeerIdJson</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Return the jsonified version of the key, matching the formatting
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toJSON"></a>PeerId.toJSON<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L107-L113" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toJSON(): <a href="#peeridjson">PeerIdJson</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Return the jsonified version of the key, matching the formatting
|
||||||
of go-ipfs for its config file.</p>
|
of go-ipfs for its config file.</p>
|
||||||
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peeridjson">PeerIdJson</a></code><span>
|
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="#peeridjson">PeerIdJson</a></code><span>
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toHexString"></a>PeerId.toHexString<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L120-L122" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toHexString(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Returns the Peer ID's <code>id</code> as a hex string.</p>
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toHexString"></a>PeerId.toHexString<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L120-L122" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toHexString(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Returns the Peer ID's <code>id</code> as a hex string.</p>
|
||||||
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code><span>
|
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code><span>
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toBytes"></a>PeerId.toBytes<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L129-L131" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toBytes(): <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Returns the Peer ID's <code>id</code> as a buffer.</p>
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toBytes"></a>PeerId.toBytes<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L129-L131" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toBytes(): <a href="https://nodejs.org/api/buffer.html">Buffer</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Returns the Peer ID's <code>id</code> as a buffer.</p>
|
||||||
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://nodejs.org/api/buffer.html">Buffer</a></code><span>
|
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://nodejs.org/api/buffer.html">Buffer</a></code><span>
|
||||||
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toB58String"></a>PeerId.toB58String<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L138-L140" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toB58String(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Returns the Peer ID's <code>id</code> as a base58 string.</p>
|
</span></div></div></div><div data-radium="true"><h3 data-radium="true"><a class="anchor" name="PeerId#toB58String"></a>PeerId.toB58String<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L138-L140" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h3><pre><code>toB58String(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code></pre><div style="margin-top:11.5px;margin-bottom:11.5px;" data-radium="true"><p>Returns the Peer ID's <code>id</code> as a base58 string.</p>
|
||||||
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code><span>
|
</div><div data-radium="true"><h4>Returns</h4><div data-radium="true"><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code><span>
|
||||||
</span></div></div></div></div></div><div style="margin-bottom:92px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="PeerIdJson"></a>PeerIdJson<a href="https://github.com/libp2p/js-peer-id/blob/344629513a9fce271bdca9b1c1d88b69fdc4974b/src/index.js#L24-L141" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h1><div></div></div></div></div><div style="clear:both;" data-radium="true"></div></div><div style="clear:both;" data-radium="true"></div></div><style>@media (min-width: 768px){ .rmq-16930d56{width: 750px !important;}}
|
</span></div></div></div></div></div><div style="margin-bottom:92px;" data-radium="true"><h1 data-radium="true"><a class="anchor" name="PeerIdJson"></a>PeerIdJson<a href="https://github.com/libp2p/js-peer-id/blob/01957fa09515bb868e60d301a490be22811fbf06/src/index.js#L24-L141" title="src/index.js" style="float:right;" data-radium="true"><svg fill="currentColor" preserveAspectRatio="xMidYMid meet" height="1em" width="1em" viewBox="0 0 40 40" style="vertical-align:middle;"><g><path d="m26.3 7.5l-3.8 3.8 8.8 8.7-8.8 8.8 3.8 3.7 11.2-12.5-11.2-12.5z m-12.5 0l-11.3 12.5 11.3 12.5 3.7-3.7-8.7-8.8 8.7-8.7-3.7-3.8z"></path></g></svg></a></h1><div></div></div></div></div><div style="clear:both;" data-radium="true"></div></div><div style="clear:both;" data-radium="true"></div></div><style>@media (min-width: 768px){ .rmq-16930d56{width: 750px !important;}}
|
||||||
@media (min-width: 992px){ .rmq-c587a2b1{width: 970px !important;}}
|
@media (min-width: 992px){ .rmq-c587a2b1{width: 970px !important;}}
|
||||||
@media (min-width: 1200px){ .rmq-27601239{width: 1170px !important;}}
|
@media (min-width: 1200px){ .rmq-27601239{width: 1170px !important;}}
|
||||||
@media (min-width: 480px){ .rmq-16dbe3a4{float: left !important;}}
|
@media (min-width: 480px){ .rmq-16dbe3a4{float: left !important;}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user