cbor / cbor.github.io

cbor.io web site
75 stars 33 forks source link

.NET has a standard implementation now #87

Open voronoipotato opened 2 years ago

voronoipotato commented 2 years ago

https://docs.microsoft.com/en-us/dotnet/api/system.formats.cbor?view=dotnet-plat-ext-6.0

I wouldn't say its as feature full as the one you provided https://github.com/peteroupc/CBOR but it should be included so that people who aren't able or allowed to use external libraries will know that they can use CBOR in .NET now :).

charlesroddie commented 2 years ago

I wouldn't say that is an implementation. It's low-level code that could be used by an implementation.

For example, to write an array of values using that, you need to WriteStartArray() and then write the internals and then WriteEndArray(). So a user of this library needs to understand the low level workings of CBOR.

Unlike https://github.com/peteroupc/CBOR (CBORObject) which any developer can pick up and use, or the built in System.Text.Json.Nodes.JsonNode.

System.Formats.Cbor was implemented as part of COSE - CBOR Object Signing and Encryption and I believe having generally usable CBOR wasn't an objective. Is that correct @eiriktsarpalis ?

eiriktsarpalis commented 2 years ago

System.Formats.Cbor is a full implementation of the CBOR format, and does not constrain itself to COSE applications. It only surfaces low-level reader and writer types, but it should be possible to implement a type serializer on top of it: here's one that I wrote in F#.