LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
crc.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
51#ifndef JUNO_CRC_H
52#define JUNO_CRC_H
53#ifdef __cplusplus
54extern "C"
55{
56#endif
57#include <stddef.h>
58#include <stdint.h>
59
65#define M1_16 0xff
66#define M2_16 0xff00
67#define M1_32 0xffffffff
68#define M2_32 0xffffff00
76#define JUNO_ARC_CRC_INIT (0)
84uint16_t Juno_CrcArcUpdate(uint16_t iCrc, const void *pcData, size_t zDataSize);
85
86
91#define JUNO_BINHEX_CRC_INIT (0)
99uint16_t Juno_CrcBinhexUpdate(uint16_t iCrc, const void *pcData, size_t zDataSize);
100
101
108#define JUNO_CCITT_CRC_INIT (-1)
116uint16_t Juno_CrcCcittUpdate(uint16_t iCrc, const void *pcData, size_t zDataSize);
117
118
125#define JUNO_CCITT32_CRC_INIT (-1)
133uint32_t Juno_CrcCcitt32Update(uint32_t iCrc, const void *pcData, size_t zDataSize);
134
135
140#define JUNO_KERMIT_CRC_INIT (0)
148uint16_t Juno_CrcKermitUpdate(uint16_t iCrc, const void *pcData, size_t zDataSize);
149
156#define JUNO_ZIP_CRC_INIT (-1)
169uint32_t Juno_CrcZipUpdate(uint32_t iCrc, const void *pcData, size_t zDataSize);
170
171#ifdef __cplusplus
172}
173#endif
174#endif
uint32_t Juno_CrcZipUpdate(uint32_t iCrc, const void *pcData, size_t zDataSize)
Update ZIP CRC (CRC-32) with new data.
Definition juno_zip.c:20
uint32_t Juno_CrcCcitt32Update(uint32_t iCrc, const void *pcData, size_t zDataSize)
Update CCITT32 CRC (32-bit) with new data.
Definition juno_ccitt32.c:20
uint16_t Juno_CrcBinhexUpdate(uint16_t iCrc, const void *pcData, size_t zDataSize)
Update BinHex CRC with new data.
Definition juno_binhex.c:21
uint16_t Juno_CrcCcittUpdate(uint16_t iCrc, const void *pcData, size_t zDataSize)
Update CCITT CRC (16-bit) with new data.
Definition juno_ccitt.c:21
uint16_t Juno_CrcArcUpdate(uint16_t iCrc, const void *pcData, size_t zDataSize)
Update ARC CRC with new data.
Definition juno_arc.c:21
uint16_t Juno_CrcKermitUpdate(uint16_t iCrc, const void *pcData, size_t zDataSize)
Update Kermit CRC with new data.
Definition juno_kermit.c:21