treecodec

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxEntries caps entries in one tree and is shared with storage ingest normalization.
	MaxEntries = 1_000_000

	// BinaryMagic is the tree format signature and part of the public codec contract.
	BinaryMagic = "YRV_TREE\x00"
)

Variables

This section is empty.

Functions

func Decode

func Decode(dataArr []byte) ([]core.TreeEntryObj, error)

Decode parses canonical tree-object bytes into entries. It validates magic and bounds before parsing, so untrusted brother-wire input returns errors instead of panics. This is the only public tree parser.

func Encode

func Encode(entriesArr []core.TreeEntryObj) ([]byte, core.HashObj, error)

Encode serializes entries into canonical tree-object bytes and tree_hash. Entries are sorted, duplicates and file-child conflicts are rejected, and it mirrors Decode.

Types

This section is empty.

Jump to

Keyboard shortcuts

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