ipld / ipld/go-car

ReadVersion can be more efficient

Open
#101 0 comments 0 reactions 0 assignees View on GitHub
P3
Dominant language
Go
Stars
175
Forks
54
Avg merge
6d 5h
Merged PRs (30d)
4

Description

* if carv1 header is of size != 10 then it is most-likely a v1
* If the carv1 header begins with a non-empty roots list then it is most likely a v1.
* If the carv1 header begins with an empty roots list, then we skip it (fixed length) and read the version.
* If we did that, we'd always read a fixed length, so we could just take a []byte.

We wouldn't support carv1-looking headers whose version is not 1, but the carv1 spec requires the version to always equal 1.

Context: https://github.com/ipld/go-car/pull/100#pullrequestreview-691564461

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.