eyg/ir/car

Work with Content Addressable aRchives (CAR / .car) v1 files

https://ipld.io/specs/transport/car/carv1/#summary

Types

pub type Car {
  Car(header: Header, blocks: List(#(v1.Cid, BitArray)))
}

Constructors

A car file does not need to contain a single DAG, so multiple roots can be present

pub type Header {
  Header(version: Int, roots: List(v1.Cid))
}

Constructors

  • Header(version: Int, roots: List(v1.Cid))

Values

pub const content_type: String

The media type a CAR file is sent as, from the IANA registry.

pub fn decode(bytes: BitArray) -> Result(Car, String)
pub fn encode(car: Car) -> Result(BitArray, String)
Search Document