Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single item array could be compressed as a single value saving one byte #62

Open
filip26 opened this issue Jul 27, 2022 · 0 comments
Open

Comments

@filip26
Copy link

filip26 commented Jul 27, 2022

Hi,
just an idea to improve compress ratio. Consider this example:

{
  "@context": {
    "type": "@type"
  }
}
{
  "@context": "...",
  "type": ["type-id1"]
}

the compressed output by this library is:

[{ 0: https...context.jsonld, 101: [type-id1] }]

101 says it's an array, and there is no need to use CBOR array marker array(1). It could be compressed as [{ 0: https...context.jsonld, 101: type-id1 }] saving one byte.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant