question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Canonical CBOR encoding

See original GitHub issue

Hey! This speed at which this library encodes is just marvelous, awesome project! I noticed however, that this speed comes at the cost of binary size, since for simple “tags” cbor-x doesn’t always choose the shortest possible, e.g.

encode(Buffer.alloc(0)) // returns <Buffer 58 00>

while other implementations return the shorter (and canonical) <Buffer 40>. I would love for this to be corrected, cbor-x is just too fast! 😃 But I can totally understand if this is something that’s been done for speed’s sake or would require major effort.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kriszypcommented, May 26, 2021

No, this is super easy, just an oversight. Should be fixed with the commit above. I’ll get a new version published soon.

0reactions
JonasKruckenbergcommented, Jul 2, 2021

Woop woop! 🥳🥳

Read more comments on GitHub >

github_iconTop Results From Across the Web

Canonical Event Log Format - Trusted Computing Group
This specification also provides a simple Type-Length-Value (TLV) encoding, a Concise Binary Object Representation (CBOR) encoding, and a JSON ...
Read more >
RFC 7049: Concise Binary Object ... - » RFC Editor
If a protocol considers "canonical" to mean that two encoder implementations starting with the same input data will produce the same CBOR output, ......
Read more >
The several canons of CBOR - ImperialViolet
There are many encoding formats. CBOR is one of them. Like several others, a subset of it basically fine—I'm not starting that fight...
Read more >
CBOR — Concise Binary Object Representation | Overview
“The Concise Binary Object Representation (CBOR) is a data format whose design goals ... In JSON, these data need to be encoded (usually...
Read more >
CBOR/PeterO.Cbor.CBOREncodeOptions.md at master - GitHub
Specifies options for encoding and decoding CBOR objects. ... When encoding, are written out using the CTAP2 canonical CBOR encoding form, which is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found