|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
CRC-16, polynomial 0x1021, computed bit by bit; see link_crc.h. More...
#include "link_crc.h"Functions | |
| uint16_t | link_crc (uint16_t crc, const void *data, size_t len) |
| Fold len bytes into crc and return the new accumulator. | |
| uint32_t | link_fnv1a32 (uint32_t hash, const void *data, size_t len) |
| FNV-1a, 32 bits: per byte, XOR then multiply by 16777619. | |
CRC-16, polynomial 0x1021, computed bit by bit; see link_crc.h.
SPDX-License-Identifier: MIT
| uint16_t link_crc | ( | uint16_t | crc, |
| const void * | data, | ||
| size_t | len ) |
Fold len bytes into crc and return the new accumulator.
Incremental, so a receiver can check a frame as it arrives without buffering it first.
| crc | The accumulator: LINK_CRC_INIT, or the value a previous call returned. |
| data | The bytes to fold in. |
| len | Number of bytes in data. |
| uint32_t link_fnv1a32 | ( | uint32_t | hash, |
| const void * | data, | ||
| size_t | len ) |
FNV-1a, 32 bits: per byte, XOR then multiply by 16777619.
The content key of the board drawing (LINK_AW_HASH_LO/HI) next to its CRC. Not a cryptographic hash; it tells two drawings apart, it does not authenticate one. Incremental like link_crc().
| hash | The hash: LINK_FNV_INIT, or the value a previous call returned. |
| data | The bytes to fold in. |
| len | Number of bytes in data. |