From c0109cbcdc86cf0f292f03bb5ffff75fc69b0066 Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Mon, 5 Dec 2016 16:16:12 +0100 Subject: [PATCH] Updates --- index.html | 54 +++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/index.html b/index.html index 1c5cf46..4ac2fd4 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,8 @@ color: #000; font-family: Roboto, sans-serif; font-weight: 300; line-height: 26px; -font-size: 17px;}
peer-id
0.8.0
peer-id
0.8.0

PeerIdJson

Parameters

NameDescription
id: stringBase58 +font-weight: bold;}.hljs-deletion{background: #fdd;}.hljs-addition{background: #dfd;}.hljs-emphasis{font-style: italic;}.hljs-strong{font-weight: bold;}

PeerIdJson

Parameters

Name
Description
id: string
Base58 encoded peer id -
privKey: string?The RSA private key in protobuf format, encoded in +
privKey: string?
The RSA private key in protobuf format, encoded in base64 . -
pubKey: string?The RSA public key in protobuf format, encoded in +
pubKey: string?
The RSA public key in protobuf format, encoded in base64 . -

PeerId

A Peer ID is the SHA-256 +

PeerId

A Peer ID is the SHA-256 multihash of a public key.

static

PeerId.create

create(opts: Object?, callback: function (Error, PeerId))

Create a new PeerId by generating a new public/private keypair.

-

Parameters

NameDescription
opts: Object?Configuration object. -
opts.bits: number? (=2048)How many bits to use for the RSA key generation. -
callback: function (Error, PeerId)Node.js style callback. -

Example

const PeerId = require('peer-id')
+

Parameters

Name
Description
opts: Object?
Configuration object. +
opts.bits: number? (=2048)
How many bits to use for the RSA key generation. +
callback: function (Error, PeerId)
Node.js style callback. +

Example

const PeerId = require('peer-id')
 
 PeerId.create((err, id) => {
   if (err) {
@@ -72,23 +73,23 @@ PeerId.create((err, idconsole.log('id', JSON.stringify(id))
 })

PeerId.createFromHexString

createFromHexString(str: string): PeerId

Creates a Peer ID from hex string representing the key's multihash.

-

Parameters

NameDescription
str: stringHex encoded id -

Returns

Parameters

Name
Description
str: string
Hex encoded id +

Returns

PeerId.createFromBytes

createFromBytes(buf: Buffer): PeerId

Creates a Peer ID from a buffer representing the key's multihash.

-

Parameters

NameDescription
buf: Buffer

Returns

Parameters

Name
Description
buf: Buffer

Returns

PeerId.createFromB58String

createFromB58String(str: string): PeerId

Creates a Peer ID from a base58 string representing the key's multihash.

-

Parameters

NameDescription
str: stringbase58 +

Parameters

Name
Description
str: string
base58 encoded id -

Returns

Returns

PeerId.createFromPubKey

createFromPubKey(key: (string | Buffer), callback: function (Error, PeerId))

Creates a Peer ID from a buffer containing a public key.

-

Parameters

NameDescription
key: (string | Buffer)
callback: function (Error, PeerId)

PeerId.createFromPrivKey

createFromPrivKey(key: (string | Buffer), callback: function (Error, PeerId))

Creates a Peer ID from a buffer containing a private key.

-

Parameters

NameDescription
key: (string | Buffer)The private key, if passed as +

Parameters

Name
Description
key: (string | Buffer)
callback: function (Error, PeerId)

PeerId.createFromPrivKey

createFromPrivKey(key: (string | Buffer), callback: function (Error, PeerId))

Creates a Peer ID from a buffer containing a private key.

+

Parameters

Name
Description
key: (string | Buffer)
The private key, if passed as string base64 encoding is assumed. -
callback: function (Error, PeerId)

PeerId.createFromJSON

createFromJSON(obj: PeerIdJson, callback: function (Error, PeerId))

Import a PeerId from a serialized JSON object.

-

Parameters

NameDescription
obj: PeerIdJson
callback: function (Error, PeerId)

instance

constructor

constructor(id: Buffer, privKey: RSAPrivateKey?, pubKey: RSAPublickKey?)

Parameters

NameDescription
id: Buffer
privKey: RSAPrivateKey?
pubKey: RSAPublickKey?

PeerId.prototype.id

id: Buffer

PeerId.prototype.privKey

privKey: (RSAPrivateKey | undefined)

The private key of this id, if it exists.

+
callback: function (Error, PeerId)

PeerId.createFromJSON

createFromJSON(obj: PeerIdJson, callback: function (Error, PeerId))

Import a PeerId from a serialized JSON object.

+

Parameters

Name
Description
callback: function (Error, PeerId)

instance

constructor

constructor(id: Buffer, privKey: RSAPrivateKey?, pubKey: RSAPublickKey?)

Parameters

Name
Description
id: Buffer
privKey: RSAPrivateKey?
pubKey: RSAPublickKey?

PeerId.prototype.id

id: Buffer

PeerId.prototype.privKey

privKey: (RSAPrivateKey | undefined)

The private key of this id, if it exists.

PeerId.prototype.pubKey

pubKey: (RSAPublicKey | undefined)

The public key of this id, if it exists.

PeerId.prototype.marshalPubKey

marshalPubKey(): Buffer

Create the protobuf version of the public key, matching go-ipfs formatting.

@@ -117,15 +118,13 @@ of go-ipfs for its config file.

@media (min-width: 1200px){ .rmq-6156e77b{float: left !important;}} @media (min-width: 480px) and (max-width: 767px) { .rmq-21ab0466{width: 50.00000% !important;}} @media (min-width: 768px) and (max-width: 991px) { .rmq-a01b93a4{width: 50.00000% !important;}} -@media (min-width: 992px) and (max-width: 1199px) { .rmq-2a768b19{width: 41.66667% !important;}} -@media (min-width: 1200px) { .rmq-53e2f0cf{width: 41.66667% !important;}} -@media (min-width: 480px) and (max-width: 767px) { .rmq-5c4c5b38{width: 8.33333% !important;}} -@media (min-width: 768px) and (max-width: 991px) { .rmq-30f216fa{width: 8.33333% !important;}} -@media (min-width: 992px) and (max-width: 1199px) { .rmq-b9f121e0{width: 8.33333% !important;}} -@media (min-width: 1200px) { .rmq-295f1996{width: 8.33333% !important;}} +@media (min-width: 992px) and (max-width: 1199px) { .rmq-d226cb7e{width: 50.00000% !important;}} +@media (min-width: 1200px) { .rmq-5cc71c8{width: 50.00000% !important;}} +@media (min-width: 480px) and (max-width: 767px) { .rmq-77267d84{width: 25.00000% !important;}} @media (min-width: 768px) and (max-width: 991px) { .rmq-5c0c1446{width: 25.00000% !important;}} @media (min-width: 992px) and (max-width: 1199px) { .rmq-4605701c{width: 25.00000% !important;}} @media (min-width: 1200px) { .rmq-34ee8e6a{width: 25.00000% !important;}} +@media (min-width: 480px) and (max-width: 767px) { .rmq-5c4c5b38{width: 8.33333% !important;}} @media (max-width: 479px){ .rmq-35757987{display: none !important;}} @media (min-width: 480px) and (max-width: 767px) { .rmq-f09e82ae{display: none !important;}} @media (min-width: 480px) and (max-width: 767px) { .rmq-89bb2272{width: 100.00000% !important;}} @@ -134,4 +133,9 @@ of go-ipfs for its config file.

@media (min-width: 1200px) { .rmq-3b9282ea{width: 66.66667% !important;}} @media (min-width: 768px) and (max-width: 991px) { .rmq-4d29a8df{left: 33.33333% !important;}} @media (min-width: 992px) and (max-width: 1199px) { .rmq-ea7683a5{left: 33.33333% !important;}} -@media (min-width: 1200px) { .rmq-ad95cc33{left: 33.33333% !important;}}
\ No newline at end of file +@media (min-width: 1200px) { .rmq-ad95cc33{left: 33.33333% !important;}} +@media (min-width: 480px) and (max-width: 767px) { .rmq-61e2cd20{width: 33.33333% !important;}} +@media (min-width: 768px) and (max-width: 991px) { .rmq-6a8184e2{width: 33.33333% !important;}} +@media (min-width: 992px) and (max-width: 1199px) { .rmq-8dd7a0f8{width: 33.33333% !important;}} +@media (min-width: 1200px) { .rmq-2189018e{width: 33.33333% !important;}} +@media (min-width: 480px) and (max-width: 767px) { .rmq-4828d204{width: 66.66667% !important;}} \ No newline at end of file