multiformats / multicodec

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

Add varint encoding of code to table #297

Open whyrusleeping opened 1 year ago

whyrusleeping commented 1 year 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 1 year 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.