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

Define CAR v2 fixed prefix and header #80

Merged
merged 4 commits into from
Jun 11, 2021
Merged

Define CAR v2 fixed prefix and header #80

merged 4 commits into from
Jun 11, 2021

Commits on Jun 10, 2021

  1. Define basic CAR v2 constants along with tests

    Define the magic CAR v2 prefix proposed in ipld/specs#248 and assert
    that it remains a valid CAR v1 header, along with other tests that
    verify the expected length, content and version number.
    
    Define basic structs to represent CAR v2 header, along with placeholder
    for the future "characteristics" bitfield, and the optional padding
    between CAR v1 dump and index added to the end of a CAR v2 archive.
    
    Relates to:
    - ipld/specs#248 (comment)
    masih committed Jun 10, 2021
    Configuration menu
    Copy the full SHA
    334e423 View commit details
    Browse the repository at this point in the history
  2. Export constant header size

    Reflecting on PR review comments, no harm in exposing this and it may be
    useful to the users of the library.
    masih committed Jun 10, 2021
    Configuration menu
    Copy the full SHA
    d1ce5e1 View commit details
    Browse the repository at this point in the history
  3. Add CarV1Offset field to CAR v2 header

    Reflecting on the review comment, adding this field could provide
    optimisation opportunities in the future in the context of block
    alignment.
    
    See:
    - https://github.com/ipld/go-car/pull/80/files#r649241583
    masih committed Jun 10, 2021
    Configuration menu
    Copy the full SHA
    4d78ab2 View commit details
    Browse the repository at this point in the history
  4. Fix test case name to reflect what the test is

    Now that the `CarV1Offset` is added to the header, the size is increased
    from `32` to `40` bytes. Make it so in the test case name.
    masih committed Jun 10, 2021
    Configuration menu
    Copy the full SHA
    aa69c9d View commit details
    Browse the repository at this point in the history