Merge pull request #86 from libp2p/docs/readme-tweaks

docs: various readme tweaks
This commit is contained in:
Pedro Teixeira 2018-10-12 19:58:47 +01:00 committed by GitHub
commit b388257b69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,6 +144,7 @@ Creates a Peer ID from hex string representing the key's multihash.
Creates a Peer ID from a buffer representing the key's multihash.
### `createFromB58String(str)`
Creates a Peer ID from a Base58 string representing the key's multihash.
### `createFromPubKey(pubKey)`
@ -161,8 +162,8 @@ Creates a Peer ID from a buffer containing a private key.
### `createFromJSON(obj)`
- `obj.id: String` - The multihash encoded in `base58`
- `obj.pubKey: String` - The public key in protobuf format, encoded in 'base64'
- `obj.privKey: String` - The private key in protobuf format, encoded in 'base 64'
- `obj.pubKey: String` - The public key in protobuf format, encoded in `base64`
- `obj.privKey: String` - The private key in protobuf format, encoded in `base64`
## Export
@ -198,10 +199,9 @@ Returns an `obj` of the form
- `obj.pubKey: String` - The public key in protobuf format, encoded in 'base64'
- `obj.privKey: String` - The private key in protobuf format, encoded in 'base 64'
### `toPrint()`
Returns the Peer ID as a printable string.
Returns the Peer ID as a printable string without the `Qm` prefix.
Example: `<peer.ID xxxxxx>`