NAME

Archive::CAR::v2 - CAR version 2 implementation

SYNOPSIS

use Archive::CAR::v2;

my $v2 = Archive::CAR::v2->new();
$v2->read($file_handle);

DESCRIPTION

Archive::CAR::v2 implements the reading and writing of Content Addressable Archive (CAR) version 2 files. This version adds a fixed-length header and an optional index for fast block access.

METHODS

version()

Returns 2.

read($fh)

Reads the CAR v2 header and the inner CAR v1 archive using standard buffered I/O.

write($fh, $roots, $blocks)

Writes a CAR v2 archive with a generated index using standard buffered I/O.

header()

Returns a hash reference containing v2 header metadata.

SEE ALSO

https://ipld.io/specs/transport/car/carv2/, Archive::CAR, Archive::CAR::v1, Archive::CAR::Indexer

AUTHOR

Sanko Robinson <sanko@cpan.org>

COPYRIGHT

Copyright (C) 2026 by Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.