multiformats / multicodec

Compact self-describing codecs. Save space by using predefined multicodec tables.
MIT License
340 stars 205 forks source link

Add varint encoding of code to table #297

Open whyrusleeping opened 2 years ago

whyrusleeping commented 2 years ago

For a large number of usecases people need to varint encode the multicodec value before making use of it, it might be useful to add that alongside the code in another column. The failure mode i've observed recently is someone taking the hex for the multicodec, writing it down as bytes, and being confused when things don't line up.

rvagg commented 2 years ago

Yeah, fair enough, we had an instance of this kind of confusion recently in a discussion.

The table format is pretty difficult to change at the moment because it's consumed by many automated tools that assume specific columns, and adding a column at the end may not be as useful since it'd be hidden but we've been talking about making a JSON form as the authoritative form which compiles to the CSV, that might be a good place to put it.