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

Switch to binary format and more. #38

Closed
dimich-g opened this issue Feb 11, 2017 · 8 comments
Closed

Switch to binary format and more. #38

dimich-g opened this issue Feb 11, 2017 · 8 comments

Comments

@dimich-g
Copy link
Collaborator

Hi,

Capturing recent conversations with @jyasskin and @mrdewitt:

  1. We think it makes sense to switch to 100% binary format since the header compression and parts body compression makes it mostly binary anyways. It also lets us to replace MIME boundary strings with direct chunk-size kind of encoding.
  2. The Explainer and samples in it will be gradually updated to reflect switch to binary encoding. While in update, there can be some inconsistency in the doc.

Also discussed:

  • Binary alignment at 32 bit boundaries (decided not to)
  • Use Self-Delimiting Numeric Values (rfc 6256) (decided not to)
  • Split content index and offset table (so the resources may be rearranged)
  • Multiple hashes (to support deprecation of old ones)
  • Cross-signing
@lrosenthol
Copy link

lrosenthol commented Feb 14, 2017 via email

@jyasskin
Copy link
Member

jyasskin commented Feb 14, 2017

@lrosenthol Which existing one? Note the considerations at https://github.com/w3ctag/packaging-on-the-web#rejected-approaches

@jyasskin
Copy link
Member

CBOR is an option for the package structure, and it even has a draft schema definition language, CDDL. It won't be quite as compact as something we do custom, but it'll be easier to debug and to extend in the future.

@dimich-g
Copy link
Collaborator Author

CBOR looks interesting. It seems to support streaming on receiving end as well.

@lrosenthol
Copy link

lrosenthol commented Feb 16, 2017 via email

@dimich-g
Copy link
Collaborator Author

There are 2 orthogonal things - binary encoding and then an index/manifest/hashing structure. Formats like CBOR provide the former w/o attempting to provide the latter. So if we want specific structure and content of the package metadata (index, manifest, certificates and hashes), and don't care much about the way to assemble those pieces into a binary file with chunks of certain size is not important.

The main issue with Zip and other archiving formats is they mostly were developed without streaming on receiving and with fixed and/or limited set of metadata, and they will have to be 'augmented' in one way or another.

CBOR seems to be a simple way to assemble length-prefixed and variable-length records, arrays and maps, and supports variable-length numbers, byte blobs and UTF-8 strings. No notion of a directory or hashing, which seems to be a good thing since those are exactly the subject of this proposal.

@mrdewitt
Copy link
Collaborator

mrdewitt commented Feb 16, 2017 via email

@jyasskin
Copy link
Member

Fixed by #36.

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

4 participants