Documentation
¶
Overview ¶
Package crc16 implements the 16-bit cyclic redundancy check, or CRC-16, checksum. See https://en.wikipedia.org/wiki/Cyclic_redundancy_check for information.
The fitTable and compute algorithm that are used to compute the CRC-16 checksum is belong to Garmin or its affiliates and the usage of this package should comply with their terms and conditions. The Authors doesn't own any of those materials except only the code implementation in go.
Index ¶
Constants ¶
const (
Size = 2 // An uint16 requires 2 bytes to be represented in its binary form.
)
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a new hash.Hash16 computing the CRC-16 checksum using the polynomial represented by the Table. If table is nil, default FIT table will be used. The computing algorithm is using FIT algorithm defined in [https://developer.garmin.com/fit/protocol]. Its Sum method will lay the value out in big-endian byte order.
Types ¶
type Table ¶
type Table [16]uint16
Table is [16]uint16
func MakeFITTable ¶ added in v0.15.0
func MakeFITTable() *Table
MakeFITTable makes new table as defined in [https://developer.garmin.com/fit/protocol]