5 ms·
CBOR: It’s like JSON but fast and small but also an official IETF standard. https://cbor.io/ https://cbor.io/
by mdhb 2y ago
CBOR: It’s like JSON but fast and small but also an official IETF standard.
https://cbor.io/ https://cbor.io/
- nmadden 2y agoCBOR is basically a fork of MsgPack. I prefer the original - it’s simpler and there are more high-quality implementations available.
- jpc0 2y agoCBOR is actively used in the WebAuthN spec (passkeys) so browsers ship with en implementation... And if you intend to support it even via a library you will be shipping an implementation as well. https://www.w3.org/TR/webauthn-2/#sctn-conforming-all-classes https://www.w3.org/TR/webauthn-2/#sctn-conforming-all-classe...
- throw5959 2y agoWhich Web API can encode and decode CBOR? I'm not aware of any, and unless I'm mistaken you will need to ship your own implementation in any case.
- camgunz 2y agoDisclaimer: I wrote and maintain a MessagePack implementation. Reading through this, it looks like they toss out indefinite length values, "canonicalization", and tags, making it essentially MP (MP does have extension types, I should say). https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#ctap2-canonical-cbor-encoding-form https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-cl...
- feverzsj 2y agoIt's too complex, and the implementation is poor[0]. [0]: https://github.com/getml/reflect-cpp/tree/main/benchmarks https://github.com/getml/reflect-cpp/tree/main/benchmarks
- otabdeveloper4 2y agoCBOR is a standard, not an implementation. As a standard it's almost exactly the same as MsgPack, the difference is mostly just that CBOR filled out underspecified parts of MsgPack. (Things like how extensions for custom types work, etc.)
- tjoff 2y agoImplementation is poor because of performance? Performance is just one aspect, and using poor to describe it is very misleading. Say not performant if that is what you meant.
- camgunz 2y agoDisclaimer: I wrote and maintain a MessagePack implementation. CBOR is MessagePack. The story is that Carsten Bormann wanted to create an IETF standardized MP version, the creators asked him not to (after he acted in pretty bad faith), he forked off a version, added some very ill-advised tweaks, named it after himself, and submitted it anyway. I wrote this up years ago (https://news.ycombinator.com/item?id=14072598 https://news.ycombinator.com/item?id=14072598), and since then the only thing they've addressed is undefined behavior when a decoder encounters an unknown simple value.
- mdhb 2y agoInteresting bit of context I wasn’t aware of. Thanks for that.