package irmin-pack

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

This module defines abstractions over entries in the pack file, which are encoded as follows:

      ┌────────┬────────┬──────────────┬─────────┐
      │  Hash  │  Kind  │  Len(Value)? │  Value  │
      └────────┴────────┴──────────────┴─────────┘
      ┆<┄ H ┄┄>┆<┄ K ┄┄>┆<┄┄┄┄ L? ┄┄┄┄>┆<┄┄ V ┄┄>┆
      ┆<┄┄┄┄┄┄┄┄┄┄┄ entry length, E ┄┄┄┄┄┄┄┄┄┄┄┄>┆

The fields are as follows:

  • Hash: the (fixed-length) hash of the data stored in this entry;
  • Kind: the kind of data being stored (contents, nodes, commits etc.), encoded as a single "magic" character;
  • Len(Value): an optional length header for the Value section of the entry (not including the length of the length header itself), encoded using a variable-length encoding (LEB128). The presence of a length header is determined by the Kind character.
  • Value: the data itself.

The length of the overall pack entry, as referenced in the Pack_index or in a direct Pack_key.t, is equal to E = H + K + L + V.

module Kind : sig ... end
module type S = sig ... end
module type Config = sig ... end
module Of_contents (_ : Config) (Hash : Irmin.Hash.S) (Key : sig ... end) (Contents : Irmin.Contents.S) : S with type t = Contents.t and type hash = Hash.t and type key = Key.t
module Of_commit (Hash : Irmin.Hash.S) (Key : Irmin.Key.S with type hash = Hash.t) (Commit : Irmin.Commit.Generic_key.S with type node_key = Key.t and type commit_key = Key.t) : sig ... end
OCaml

Innovation. Community. Security.