crc

package
v0.0.0-...-3eac474 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checksum

func Checksum(init uint16, data []byte, table Table) (crc uint16)

Checksum generate CRC from data using a table

Types

type CRC

type CRC struct {
	Name    string
	Init    uint16
	Poly    uint16
	Residue uint16
	// contains filtered or unexported fields
}

CRC handles checking CRCs for packets

func NewCRC

func NewCRC(name string, init, poly, residue uint16) (crc CRC)

NewCRC setup a new CRC instance

func (CRC) Checksum

func (crc CRC) Checksum(data []byte) uint16

Checksum generate CRC from data

func (CRC) String

func (crc CRC) String() string

type Table

type Table [256]uint16

Table CRC table

func NewTable

func NewTable(poly uint16) (table Table)

NewTable sets up a new CRC table

Jump to

Keyboard shortcuts

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