crc

package
v0.0.0-...-32b1a53 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRC16_CHECKSUM_LENGTH_BYTES = 2
)
View Source
const (
	CRC32_CHECKSUM_LENGTH_BYTES = 4
)

Variables

Keeping this here for convenience, as it is not obvious to all that "CRC32c" maps to the Castagnoli algorithm.

Functions

This section is empty.

Types

type CRC16Adapter

type CRC16Adapter struct {
	*crc16.Table
}

Supports append and strip/verify CRC16 checksums. Implements the satcom.Adapter interface.

func NewCRC16Adapter

func NewCRC16Adapter(cfg CRC16AdapterConfig) (*CRC16Adapter, error)

func (*CRC16Adapter) MakeChecksum

func (a *CRC16Adapter) MakeChecksum(v []byte) []byte

func (*CRC16Adapter) MessageSize

func (a *CRC16Adapter) MessageSize(n int) (int, error)

func (*CRC16Adapter) Unwrap

func (a *CRC16Adapter) Unwrap(v []byte) ([]byte, error)

func (*CRC16Adapter) Wrap

func (a *CRC16Adapter) Wrap(v []byte) ([]byte, error)

type CRC16AdapterConfig

type CRC16AdapterConfig struct {
	Algorithm crc16.Params
}

type CRC32Adapter

type CRC32Adapter struct {
	*crc32.Table
}

Supports append and strip/verify CRC32 checksums. Implements the satcom.Adapter interface.

func NewCRC32Adapter

func NewCRC32Adapter(cfg CRC32AdapterConfig) (*CRC32Adapter, error)

func (*CRC32Adapter) MessageSize

func (a *CRC32Adapter) MessageSize(n int) (int, error)

func (*CRC32Adapter) Unwrap

func (a *CRC32Adapter) Unwrap(v []byte) ([]byte, error)

func (*CRC32Adapter) Wrap

func (a *CRC32Adapter) Wrap(v []byte) ([]byte, error)

type CRC32AdapterConfig

type CRC32AdapterConfig struct {
	Algorithm uint32
}

Jump to

Keyboard shortcuts

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