Documentation ¶
Overview ¶
Package crc16 implements the 16-bit cyclic redundancy check, or CRC-16, checksum. See http://en.wikipedia.org/wiki/Cyclic_redundancy_check and http://www.ross.net/crc/download/crc_v3.txt for information.
Index ¶
Constants ¶
View Source
const (
IBM = 0x8005 // x^16 + x^15 + x^2 + x^0
)
Predefined polynomials.
View Source
const Size = 2
Size of a CRC-16 checksum in bytes.
Variables ¶
View Source
var IBMTable = makeTable(IBM)
IBMTable is the table for the IBM polynomial.
Functions ¶
func Checksum ¶
Checksum returns the CRC-16 checksum of data, using the polynomial represented by the Table.
func ChecksumIBM ¶
ChecksumIBM returns the CRC-16 checksum of data using the IBM polynomial.
func New ¶
New creates a new hashutil.Hash16 computing the CRC-16 checksum using the polynomial represented by the Table.
Types ¶
Click to show internal directories.
Click to hide internal directories.