Skip to content

Create a stateful CBOR reader #32046

@bartonjs

Description

@bartonjs

Create a reader for CBOR (Concise Binary Object Representation), as defined in IETF RFC 7049.

  • Initial implementation should be done directly into a test project
  • Assume a new, netstandard2.0-based package (hedged bet)
  • After the reader and writer are stable and feature complete, schedule an API review
  • After API review, and associated changes, split things into ref/src/test with the declared package.

Rough project plan (approximately a PR for each stage, and 3-5 days of work)

  • Support reading "unsigned" (positive) integers, negative integers, definite-length byte strings, definite-length text strings, as well as content-agnostic structure (e.g. "what kind of thing is next" and "skip this value").
  • Support reading definite length arrays.
  • Support reading definite length maps
    • Note that maps are like Dictionary<object, object>... key types are heterogeneous.
  • Support reading indefinite-length byte strings and text strings
    • Nesting is not permitted
  • Support reading indefinite-length arrays and maps
    • Nesting is permitted, but mean distinct objects.
  • Support reading major type 7 (float: half, single, double; boolean: true false; null; undefined; and "not yet defined" values
  • Support reading tags, especially with Skip and as map keys.
    • What does the read method return? Where is the reader positioned after reading the tag?
  • Support important tagged types
    • The two DateTimeOffset types
    • Maybe the two BigInteger types
    • The "Self-describing" type
  • Add support for reader "conformance levels" / "canonicalization modes"

The reader is needed before the writer, so writing/testing the writer should not hold up a functioning reader.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions