LibJuno
0.42.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno_ccitt32.c
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
*/
17
#include "
juno/crc/crc.h
"
18
#include "
ccitt32.h
"
19
20
uint32_t
Juno_CrcCcitt32Update
(uint32_t iCrc,
const
void
*pcData,
size_t
zDataSize)
21
{
22
23
register
uint32_t crc = iCrc;
24
register
const
uint8_t *cp = pcData;
25
register
size_t
cnt = zDataSize;
26
27
while
(cnt--) {
28
crc=((crc<<8)&
M2_32
)^
ccitt32_crctab
[((crc>>24)&0xff)^*cp++];
29
}
30
31
return
(crc);
32
}
ccitt32.h
ccitt32_crctab
static const uint32_t ccitt32_crctab[256]
Definition
ccitt32.h:18
crc.h
M2_32
#define M2_32
Definition
crc.h:28
Juno_CrcCcitt32Update
uint32_t Juno_CrcCcitt32Update(uint32_t iCrc, const void *pcData, size_t zDataSize)
Definition
juno_ccitt32.c:20
src
crc
juno_ccitt32.c
Generated by
1.9.8