Follow

I'm writing a CBOR wrapper. It's supposedly optional, but does anyone know how to *not* decode semantic tags?

Like, say, in the middle of a Map you have Tag, Byte String, Byte String.
How do you know if the Tag takes up 0, 1, 2, or etc. of those byte strings, given that changes whether they're part of a key or a value?

( @lightdark ? )

@codepuppy I believe that semantic tagging always affects exactly one value, so if you wanted to take multiple you'd be required to wrap them in an array

@lightdark I was just starting to realize that XD

What confused me was "multiple" under Data Item in the registry: iana.org/assignments/cbor-tags

But I think it means a single item of multiple possible types!

Thanks so much for the confirmation! :D

@lightdark

Also FYI, world, to anyone confused about another question I had and then answered,

Semantic Tags can tag other Semantic Tags! (if their tag type allows for it ofc)

Otherwise encryption (Id 16) and Mark-for-Backreferences (Id 28) and other very generic ones wouldn't be so useful!

And it does officially say so in the spec: tools.ietf.org/html/rfc7049#se

[A tag always applies to the item that is directly followed by it.
Thus, if tag A is followed by tag B, which is followed by...]

Sign in to participate in the conversation
Mathstodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!