Documentation ¶
Overview ¶
Package crc16 implements the 16-bit cyclic redundancy check, or CRC-16, checksum.
Index ¶
Constants ¶
View Source
const (
CCITTFalse = 0x1021
)
Predefined polynomials.
View Source
const Size = 4
The size of a CRC-16 checksum in bytes.
Variables ¶
View Source
var CCITTFalseTable = simpleMakeTable(CCITTFalse)
CCITTFalseTable is the table for the CCITT-FALSE polynomial.
Functions ¶
func Checksum ¶
Checksum returns the CRC-16 checksum of data using the polynomial represented by the Table.
func ChecksumCCITTFalse ¶
ChecksumCCITTFalse returns the CRC-16 checksum of data using the CCITT-FALSE polynomial.
Types ¶
type Hash16 ¶
Hash16 is the common interface implemented by all 16-bit hash functions.
func NewCCITTFalse ¶
func NewCCITTFalse() Hash16
NewCCITTFalse creates a new Hash16 computing the CRC-16 checksum using the IEEE polynomial.
Click to show internal directories.
Click to hide internal directories.