Skip to content

Creating a finite/fixed-size map #123

Description

@Avamander

Quite a few embedded libraries do not like indefinite-sized CBOR maps (or arrays for that matter).

For demonstration, I created a map with:

            new CborEncoder(baos).encode(new CborBuilder()
                    .startMap(4)
                    .put("Timestamp", 123456789)
                    .end()
                    .build()

and the resulting map is:

BF                         # map(*)
   69                      # text(9)
      54696D657374616D70   # "Timestamp"
   1A 075BCD15             # unsigned(123456789)

Is there a way to assemble a map that has a specified length in the end result?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions