Skip to content

Commit 510ca0d

Browse files
authored
Make explicit that you can use ipfs cid format to convert both ways
It took me a moment to realise that this was possible, so wanted to save that moment for future generations of IPFS newbies.
1 parent 5d7b1bb commit 510ca0d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/concepts/content-addressing.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ v0.toV1().toString()
147147

148148
### v1 to v0
149149

150+
Similarly, the built-in `ipfs cid format` command can be used to convert the other way from the command line:
151+
152+
```
153+
$ ipfs cid format -v 0 bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
154+
QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
155+
```
156+
150157
Given a CID v1, JS users can convert back to v0 using the `toV0()` method provided by the [`multiformats`](https://www.npmjs.com/package/multiformats) library:
151158

152159
```js

0 commit comments

Comments
 (0)