kopia lustrzana https://github.com/rs1729/RS
crc_polymod: input bugfix
rodzic
1174a2cf7e
commit
121076765f
|
@ -8,7 +8,7 @@
|
||||||
// CRC16
|
// CRC16
|
||||||
// Generatorpolynom x^16+x^12+x^5+1 = (1) 0001 0000 0010 0001 = 0x(1)1021
|
// Generatorpolynom x^16+x^12+x^5+1 = (1) 0001 0000 0010 0001 = 0x(1)1021
|
||||||
#define CRC 16
|
#define CRC 16
|
||||||
#define CODELEN_CRC (2*0xDF)
|
#define CODELEN_CRC 1024 //(2*0xDF)
|
||||||
unsigned char msg[CODELEN_CRC],
|
unsigned char msg[CODELEN_CRC],
|
||||||
par[8];
|
par[8];
|
||||||
char bitstr[CODELEN_CRC*8+1+32*8];
|
char bitstr[CODELEN_CRC*8+1+32*8];
|
||||||
|
@ -120,7 +120,7 @@ int main(int argc, char *argv[]) {
|
||||||
if (option == CRC) {
|
if (option == CRC) {
|
||||||
|
|
||||||
msglen = strlen(str)/2;
|
msglen = strlen(str)/2;
|
||||||
if (msglen > 2*CODELEN_CRC) {
|
if (msglen > CODELEN_CRC) {
|
||||||
fprintf(stderr, "len > %d\n", CODELEN_CRC);
|
fprintf(stderr, "len > %d\n", CODELEN_CRC);
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue