mirror of
https://github.com/documentationjs/documentation.git
synced 2025-12-08 18:23:43 +00:00
* build: Use Flow syntax without comments. We're switching to Flow annotations - not Flow comments. This gives documentation.js the ability to self-document without JSDoc types and improves our compatibility with tools like prettier. Fixes #729. Fixes #709
23 lines
711 B
YAML
23 lines
711 B
YAML
toc:
|
|
- name: Highlighted section
|
|
description: |
|
|
The public key is a base64 encoded string of a protobuf containing an RSA DER
|
|
buffer. This uses a node buffer to pass the base64 encoded public key protobuf
|
|
to the multihash for ID generation.
|
|
|
|
```js
|
|
var PeerId = require('peer-id')
|
|
|
|
PeerId.create({ bits: 1024 }, (err, id) => {
|
|
console.log(JSON.stringify(id.toJSON(), null, 2)
|
|
})
|
|
```
|
|
|
|
```
|
|
{
|
|
"id": "Qma9T5YraSnpRDZqRR4krcSJabThc8nwZuJV3LercPHufi",
|
|
"privKey": "CAAS4AQwggJcAgEAAoGBAMBgbIqyOL26oV3nGPBYrdpbv..",
|
|
"pubKey": "CAASogEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMBgbIqyOL26oV3nGPBYrdpbvzCY..."
|
|
}
|
|
```
|