crc16

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

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

View Source
const (
	Size = 2 // An uint16 requires 2 bytes to be represented in its binary form.
)

Variables

This section is empty.

Functions

func New

func New(table *Table) hash.Hash16

New creates a new hash.Hash16 computing the CRC-16 checksum using the polynomial represented by the Table. 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

func MakeFitTable() *Table

MakeFitTable is the table defined in [https://developer.garmin.com/fit/protocol]

Jump to

Keyboard shortcuts

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