Skip to main content

Module pack

Module pack 

Source
Expand description

Pack file support for the content-addressed store.

Pack files bundle multiple blobs into a single file, reducing filesystem overhead for repositories with many small objects.

§Pack Format (v1)

.pack file:
  "SPCK"                    magic
  u32 LE                    version (1)
  u32 LE                    object count
  per object:
    u8                      object type (1 = blob)
    u32 LE                  uncompressed length
    u32 LE                  compressed length
    [32]                    BLAKE3 digest
    [compressed length]     Zstd frame

.idx file:
  "SIDX"                    magic
  u32 LE                    version (1)
  u32 LE                    entry count
  per entry:
    [32]                    BLAKE3 digest
    u64 LE                  offset into the .pack file

The index is sorted by digest on load so lookups binary-search.

Structs§

PackCache
Cache of loaded pack indices for efficient lookup.
PackFile
Writer/reader for .pack files.
PackIndex
A parsed, sorted .idx file.

Enums§

PackError
Errors that can occur while reading or writing pack files.