digitalbazaar / cborld

A Javascript CBOR-LD processor for web browsers and Node.js apps.
https://json-ld.github.io/cbor-ld-spec/
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

Use vocab term codec for URIs. #78

Closed davidlehn closed 3 weeks ago

davidlehn commented 5 months ago

Encode all URIs using the vocab term codec. This allows arbitrary URIs to be encoded with the same small integers as other terms. The mapping in a context needs to use a redundant form: {"URI":"URI"}. This technique assume a use case where the CBOR-LD size has high priority over context size.

I'm not sure if there are edge cases with the technique here. (Need a better test suite.) The URI codec is making assumptions when it sees a "value: int" structure that the int is a term id. Would it ever be something else there?

I'm assuming this is breaking as well as the cryptosuite branch it's on top off.