Documentation ¶
Index ¶
Constants ¶
View Source
const ( IBM = 0xA001 // IBM 16-bit ARC = 0x8005 // ARC AUG_CCITT = 0x1021 // AUG-CCITT BUYPASS = 0x8005 // BUYPASS CCITT_FALSE = 0x1021 // CCITT-FALSE CDMA2000 = 0xC867 // CDMA2000 DDS_110 = 0x8005 // DDS-110 DECT_R = 0x0589 // DECT-R DECT_X = 0x0589 // DECT-X DNP = 0x3D65 // DNP EN_13757 = 0x3D65 // EN-13757 GENIBUS = 0x1021 // GENIBUS MAXIM = 0x8005 // MAXIM MCRF4XX = 0x1021 // MCRF4XX RIELLO = 0x1021 // RIELLO T10_DIF = 0x8BB7 // T10-DIF TELEDISK = 0xA097 // TELEDISK TMS37157 = 0x1021 // TMS37157 USB = 0x8005 // USB CRC_A = 0x1021 // CRC-A KERMIT = 0x1021 // KERMIT MODBUS = 0x8005 // MODBUS X_25 = 0x1021 // X-25 XMODEM = 0x1021 // XMODEM )
Predefined polynomials.
View Source
const Size = 2
The size of a CRC-16 checksum in bytes.
Variables ¶
View Source
var IBMTable = makeTable(IBM)
Functions ¶
func Checksum ¶
Checksum returns the CRC-32 checksum of data using the polynomial represented by the Table.
func ChecksumIBM ¶
ChecksumIBM returns the CRC-16 checksum of data using the IBM polynomial.
Types ¶
type Hash16 ¶
func New ¶
New creates a new hash.Hash16 computing the CRC-16 checksum using the polynomial represented by the Table. Its Sum method will lay the value out in big-endian byte order. The returned Hash16 also implements encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to marshal and unmarshal the internal state of the hash.
Click to show internal directories.
Click to hide internal directories.