recordwire

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package recordwire supplies shared header layout for framing and protection.

Index

Constants

View Source
const (
	FixedHeaderSize   = 13
	MaxSequenceNumber = 0x0000ffffffffffff
	UnifiedFixedBits  = 0x20
	CIDBit            = 0x10
	SequenceBit       = 0x08
	LengthBit         = 0x04
	EpochMask         = 0x03
)

Variables

This section is empty.

Functions

func AppendUnifiedHeader

func AppendUnifiedHeader(
	dst []byte, epochLow uint8, sequence uint16, twoBytes bool, cid []byte, hasLength bool, payloadLen int,
) ([]byte, error)

AppendUnifiedHeader appends the selected C/S/L layout without canonicalizing it.

func DecodeHeader

func DecodeHeader(raw []byte, cidLength int) (headerLen, payloadLen int, err error)

DecodeHeader returns the header and payload lengths. It validates the header; callers check that the payload fits their record or datagram.

Types

This section is empty.

Jump to

Keyboard shortcuts

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