Questions tagged [crc]

Cyclic redundancy check. An error checking mechanism used for verifying data integrity in serial protocols.

1120 questions
4
votes
1 answer

A cyclic redundancy check algorithm that is invariant to the number of trailing bytes with a particular non-zero value

Suppose I have an arbitrary block of bytes. The block is terminated with a CRC remainder computed over the whole block using the CRC-16-CCITT algorithm, where the remainder is arranged in the big-endian byte order. After the block and the remainder,…
Pavel Kirienko
  • 1,162
  • 1
  • 15
  • 31
4
votes
2 answers

Calculating CRC in awk

Has anyone implemented the POSIX 1003.2 compiliant CRC algorithm (as output by cksum) in awk/gawk? I'm needing to do a checksum on an in memory string (not the whole file) and shelling out to call cksum is slow and expensive. My overall need is to…
CoreyStup
  • 1,488
  • 13
  • 14
4
votes
3 answers

CRC calculation by example

I'd like to confirm whether I grasped the concept of CRC calculations correctly. I'll provide two examples, the first is calculating the remainder using normal subtraction, the second uses this weird XOR stuff. Data bits: D = 1010101010. Generator…
NameZero912
  • 43
  • 1
  • 1
  • 4
4
votes
3 answers

CRC 4 implementation for C#

Solved by this code -> https://gist.github.com/Sbreitzke/b26107798eee74e39ff85800abf71fb1 I searched the web for a CRC 4 implementation in C# because I have to calculate a checksum by Changing the numbers of the barcode into Hex representation,…
Zebi
  • 8,682
  • 1
  • 36
  • 42
4
votes
2 answers

how to calculate CRC value for a file in C#.net?

i want to calculate the CRC value for a file using 32-bit algorithm in C#.net....
Jeyavel
  • 2,974
  • 10
  • 38
  • 48
4
votes
2 answers

Make CRC on stm32 match with software implementation

Upd. See the end of post for working code I'm already mad with this. How can I make checksum from CRC unit on stm32f103 match with software implementation? Stm has polynom 0x04C11DB7 and reset value 0xFFFFFFFF. So I've tried to calculate it in…
Long Smith
  • 1,339
  • 3
  • 21
  • 40
4
votes
2 answers

How to calculate CRC of a WinRAR file?

I know CRC calculation algorithm from Wikipedia. About structure of RAR file I read here. For example, there was written: The file has the magic number of: 0x 52 61 72 21 1A 07 00 Which is a break down of the following to describe an Archive…
Doman
  • 51
  • 1
  • 5
4
votes
0 answers

CRC16-CCITT (x.25) Checksum Calculation Problems

I have read about a helpful website with a CRC calculator covered in other posts, which works great, but the code provided in C language does not replicate the capabilities, unfortunately: http://www.zorc.breitbandkatze.de/crc.html The following…
KappaDragon
  • 61
  • 1
  • 6
4
votes
2 answers

CRC-CCITT (XModem) implementation in javascript

i'm trying to implement a CRC-CCITT (XModem) check in javascript without success. I need it in order to send socket string into a controller via RS232. does anyone know how to do it? or perhaps is there a sample code somewhere?? I would appreciate…
Salmonela
  • 41
  • 1
  • 2
4
votes
3 answers

What does this CRC implementation mean by having a seed value?

I am trying to implement a CRC algorithm in Verilog for the SENT sensor protocol. In a document put out by the SAE, they say their CRC uses the generator polynomial x^4 + x^3 + x^2 + 1 and a seed value of 0101. I understand the basic concept of…
fat balls
  • 131
  • 1
  • 3
  • 6
4
votes
1 answer

Converting CRC 8 function written in C to Java

I am trying to translate a CRC8 function from C to Java. I got this code from the hardware manufacturer: uint8_t CRCCalc (uint8_t* pointer, uint16_t len) { uint8_t CRC = 0x00; uint16_t tmp; while(len > 0) { tmp = CRC << 1; …
Nikita G.
  • 65
  • 1
  • 8
4
votes
1 answer

Generic CRC (8/16/32/64) combine implementation

Old Title of this question : Difference between CRC16 combine implementation vs CRC32 combine Implementation I am trying to implement CRC16 combine implementation similar to CRC32 combine implementation. I am using CRC-CCITT (Initial : 0xFFFF, Poly…
killer
  • 121
  • 1
  • 10
4
votes
3 answers

How can I check CRC of multiple zip files with zip -T

I've got bash script for checking CRC of multiple zip files: #! /bin/bash fileFormat="*.zip" for entry in `ls $fileFormat`; do echo $entry >> plikiZip done fileName=$(< plikiZip) for file in "${fileName[@]}"; do zip -T $file >>…
Thor1990
  • 63
  • 1
  • 8
4
votes
1 answer

How to configure calculation of CRC table

There are a lot of CRC calculation examples out there. Simple implementations with bit shifting and more efficient with a pre-calculated table. But there are also a lot of Parameters of a CRC beside the polynomial that affect the calculation. You…
harper
  • 13,345
  • 8
  • 56
  • 105
4
votes
6 answers

Matching CRC32 from STM32F0 and zlib

I'm working on a communication link between a computer running Linux and a STM32F0. I want to use some kind of error detection for my packets and since the STM32F0 has CRC32 hw and I have zlib with CRC32 on Linux I thought it would be a good idea to…
evading
  • 3,032
  • 6
  • 37
  • 57