car

package
v0.0.0-...-dfab0c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2023 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyHeaderV1Bytes = []byte{
	0x11,
	0xa2,
	0x65,
	0x72, 0x6f, 0x6f, 0x74, 0x73,
	0xf6,
	0x67,
	0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
	0x01,
}

EmptyHeaderV1Bytes represents the ecoded byte value of a CARv1 header with no root CIDs.

Functions

This section is empty.

Types

type Section

type Section []byte

Section represents the data in a CAR section and implements encoding of data via io.WriterTo interface It automatically encodes varint-length and CID for the given dara. All CIDs encoded by Section use cid.Raw codec with multihash.SHA2_256 digest.

func (Section) WriteTo

func (s Section) WriteTo(out io.Writer) (int64, error)

WriteTo encodes the data bytes as varint length, plus CID of data, plus data. The varint length is the sum of CID in bytes plus the data length. The CID is encoded as cid.Raw codec with multihash.SHA2_256 digest.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL