multiformats / multicodec

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

Add JSON form of table #311

Open rvagg opened 1 year ago

rvagg commented 1 year ago

Closes: #305

Draft for now, just putting it up for initial feedback.

What I think should be done to make this complete:

rvagg commented 1 year ago

Link to file as you would view it on GitHub: https://github.com/multiformats/multicodec/blob/rvagg/json/table.json

rvagg commented 1 year ago

Another alternative is to nest the 3 code values into a nested object: "code": { "hex": "0x78", "int": 120, "varint": "0x78" }. Any nested object doesn't get the padding treatment.

vmx commented 1 year ago

Either layout is fine, I'd KISS and just have non-nested values. This also makes it easier if you e.g. write your own tooling and you want to convert it quickly to CSV.