Skip to content

Conversation

@ElPaisano
Copy link
Contributor

@ElPaisano ElPaisano commented Feb 3, 2023

Draft https://bafybeieedkoyq4lndzqv6sfnqcm67lwklrk7yltfvz6aupnzluoby7ibxi.on.fleek.co/concepts/content-addressing/#cid-conversion

What this PR does

Addresses #1449

  • Updates JS CID conversion code examples to v1
  • Adds code sandbox section to embed example sandbox

@ElPaisano ElPaisano self-assigned this Feb 3, 2023
@ElPaisano ElPaisano requested a review from TMoMoreau February 3, 2023 02:19
@ElPaisano
Copy link
Contributor Author

@TMoMoreau can you review this for copy / writing things? Once we do that, I'll pass it to @2color to confirm the tech

> cid.toString('base16').substring(1)
'01701220c3c4733ec8affd06cf9e9ff50ffc6bcd2ec85a6170004bb709669c31de94391a' // "cid as hex"
```js
const cidV1StringBase256 = cidV1.toString(base16);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may make sense to show where base16 comes from (the import) and maybe even the how cidV1 is instantiated?

Copy link
Member

@2color 2color left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you had a chance to take a look at #1467?

I am torn on whether we want to have the code examples on this concepts page or move it into a guide.

If we include it, I would consider including both a Go and JS example and use the tab functionality like in the https://docs.ipfs.tech/how-to/ipfs-updater/ page.

Copy link
Member

@2color 2color left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this corrects some old packages referenced in the docs, I'm inclined to approve this already and address any additional changes in a separate PR

@2color 2color merged commit 70956a6 into ipfs:main Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text to binary section in content addressing section is outdated

2 participants