boc

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CellDescriptorSize is the fixed size of a cell descriptor in the BOC payload.
	// A cell descriptor consists of 2 bytes:
	//   - Byte 0: d1 (refs_descriptor) = refs_num(3 bits) | special(1 bit) | withHashes(1 bit) | levelMask(3 bits)
	//   - Byte 1: d2 (data_descriptor) = data length in half-bytes (4-bit units), range 0-255
	//
	// Reference: tonutils-go/tvm/cell/parse.go:129-145
	CellDescriptorSize = 2
)

Variables

This section is empty.

Functions

func HeaderLen

func HeaderLen(data []byte) (int, error)

HeaderLen calculates the header length of a BOC based on its structure.

BOC header structure:

magic(4) + flags(1) + sizeBytes(1)
+ cellsNum(cellSizeBytes) + rootsNum(cellSizeBytes) + completeNum(cellSizeBytes)
+ dataLen(sizeBytes)
+ rootIndices(rootsNum × cellSizeBytes)
+ [optional] index(cellsNum × sizeBytes, if hasIndex=true)

Reference: tonutils-go/tvm/cell/parse.go:32-88

Types

This section is empty.

Jump to

Keyboard shortcuts

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