GY-63_MS5611/libraries/Fletcher/README.md
2022-01-26 10:24:06 +01:00

1.9 KiB

Arduino CI Arduino-lint JSON check License: MIT GitHub release

FLETCHER

Arduino Library for Fletcher's checksum

Description

This library provides a Fletcher checksum of a data array.

Fletcher's checksum is in general faster than CRC but possibly not as good in detecting errors. See https://en.wikipedia.org/wiki/Fletcher%27s_checksum for details.

Relates to https://github.com/RobTillaart/CRC

Use https://github.com/RobTillaart/printHelpers to print the Fletcher64().

Tested on Arduino UNO only.

Interface

The functions are straightforward, however one should define length in terms of the data type and optional pad it with zeros.

A string "abcdef" has length 2 for fletcher64().

  • uint16_t fletcher16(uint8_t *data, uint16_t length) idem.
  • uint32_t fletcher32(uint16_t *data, uint16_t length) idem.
  • uint64_t fletcher64(uint32_t *data, uint16_t length) idem.

TODO - class version.

Operation

See examples.

Future ideas

  • improve documentation
  • test other platforms
  • Class versions
    • incremental calculate e.g. for a stream.
    • similar to CRC classes
  • look for optimizations
  • Fletcher24 ? and others?
  • generic FletcherN(). for N = 1..32