Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Private range #10

Closed
CMCDragonkai opened this issue Nov 7, 2020 · 5 comments
Closed

Private range #10

CMCDragonkai opened this issue Nov 7, 2020 · 5 comments

Comments

@CMCDragonkai
Copy link

With multiformats/multicodec#191 merged, it is now possible to use private ranges with multicodec.

Can this library support private ranges?

I think this would mean being able to register additional custom types which will be allocated into the private range. And then being able to add the multicodec for the private keys.

@CMCDragonkai
Copy link
Author

So I've just gone through py-cid and py-multicodec.

I can see that it's not possible to make use of any custom codecs. The functions multicodec.add_prefix and multicodec.is_codec is being used to check if my codec is legitimate.

I suggest that py-multicodec is given the feature to update the constants table at runtime, so it's possible for users to add their own entries to the tables in constants.py, or even merge with the constants.py.

This would enable this library to take advantage of the private range, and even use py-multicodec or more.

@dhruvbaldawa

@dhruvbaldawa
Copy link
Member

dhruvbaldawa commented Dec 1, 2020

Hi @CMCDragonkai,

I have taken the first stab at this problem here: #12

We can update py-cid to check for private ranges as well, and I guess it should fix your problem.

I feel that we can make this change without breaking the backward compatibility, while being extensible, let me know what you think of it.

@CMCDragonkai
Copy link
Author

Did you see my MR #11?

@CMCDragonkai
Copy link
Author

I had to turn multicodec into an object so I could register my private codec to it.

@rvagg
Copy link
Member

rvagg commented May 9, 2023

closing from inactivity, archiving repository

@rvagg rvagg closed this as completed May 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants