Implementing Typed Arrays with cbor2

Viewed 47

Is it possible to implement Typed Arrays using the cbor2 Python library? In the documentation I only saw that you can define a custom encoder to serialize custom objects, but instead I would like to implement Typed Arrays to reduce the number of bytes I send, like it's explained in this specification: https://datatracker.ietf.org/doc/html/rfc8746

For example, I would like to be able to say that I will send an array of 32 bits unsigned integers using a single tag that indicates the Type of the array, instead of repeating the information about the type for each value inside the array.

Are there other cbor libraries that can do that, if cbor2 can't?

1 Answers
Related