core-wg / yang-cbor

Internet-Draft for CBOR representation of YANG data
5 stars 10 forks source link

Copy over the 63-bit restriction to YANG-CBOR, too (RW) #138

Closed cabo closed 2 years ago

cabo commented 2 years ago

The SID draft constraints SIDs to being 63 bits. Should that text/constraint move to the CBOR draft instead?

Strictly speaking, the YANG-CBOR specification does not have to make this constraint; deltas from 64-bit unsigned integers do fit into CBOR 64-bit+sign integers. However, given little compiler support for 64+sign, implementers are rather likely to get this wrong. More so, as the usual source of SIDs to be used with YANG-CBOR is constrained to 63-bit integers, as you note, so there will be little testing of SID deltas that don’t fit into int64. We can defuse this situation, with no practical loss, by insisting on 63-bit unsigned integers for the SIDs in YANG-CBOR, too.