Questions tagged [crc]

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

1120 questions
6
votes
1 answer

What would a big-endian compatible version of this CRC32 method look like?

I'm working on a project that requires a CRC32 check to be done on data that is being transmitted. I would like to make my code compatible for not only Intel architecture ("Little Endian"), but for Solaris architecture ("Big Endian") as well. I've…
jiman
  • 270
  • 1
  • 3
  • 8
6
votes
4 answers

How would I get a Hash value of a users file with Javascript or Flash?

What I need to do is provide a file browser box on a web page where a user selects a file from their computer and, through javascript (or flash if necessary), some sort of Hash is returned such as CRC, MD5 or SHA1. I would prefer not to have to…
Stephen Belanger
  • 6,251
  • 11
  • 45
  • 49
6
votes
2 answers

Difference between CRC and hash method (MD5, SHA1)

Both CRC and hash methods can be used to verify the integrity of the original data. Why do most systems uses hash method nowadays?
user496949
  • 83,087
  • 147
  • 309
  • 426
6
votes
3 answers

Checksum inside Altera FPGA .jic file

I'm modifying a firmware file (.jic) JTAG Indirect Configuration File with a small algorithm, but changing data inside the file makes it unusable because there is a checksum somewhere in the file that has to be updated. I need to find where is a…
denoise
  • 1,067
  • 2
  • 14
  • 40
6
votes
1 answer

Why are CRC Polynomials given as Normal, Reversed, etc.?

I'm learning about CRCs, and search engines and SO turn up nothing on this.... Why do we have "Normal" and "Reversed" and "Reciprocal" Polynomials? Does one favor Big Endian, Little Endian, or something else?
someprogrammer
  • 229
  • 2
  • 13
6
votes
1 answer

What is the inverse of crc32_combine()'s matrix trick?

zlib's crc32_combine() takes crcA, crcB, and lengthB to calculate crcAB. # returns crcAB crc32_combine(crcA, crcB, lenB) Using concepts from Mark Adler's awesome posts here and here I was able to produce crc32_trim_trailing.pl which takes crcAB,…
Matt Cover
  • 63
  • 3
6
votes
1 answer

CRC-16-ANSI library for for Java/Groovy?

I need to compute the CRC-16 for arbitrary strings in a mixed java/groovy application. Specifically, I need the CRC-16-ANSI aka CRC-16-IBM variant (see http://en.wikipedia.org/wiki/Cyclic_redundancy_check for details; this is the modbus / USB…
Electrons_Ahoy
  • 36,743
  • 36
  • 104
  • 127
6
votes
3 answers

How to calculate CRC16 CCITT in PHP HEX?

I'm trying to use a PHP CRC16 CCITT function to calculate the checksum. A device sends me a PACKET with Checksum included: 10 00 00 00 00 00 00 00 12 51 09 08 00 18 00 04 02 14 00 0c 00 0c 02 1c 00 02 00 00 00 00 00 00 a0 77 The checksum is at…
Drace
  • 699
  • 9
  • 23
6
votes
2 answers

Understanding two different ways of implementing CRC generation with LFSR

There are two ways of implementing CRC generation with linear feedback shift registers (LFSR), as shown in this figure . The coefficients of generator polynomial in this picture are 100111, and the red "+" circles are exclusive-or operators. The…
shva
  • 529
  • 2
  • 7
  • 13
6
votes
3 answers

CRC preset and residue

I am working with a device that requires me to generate a 16 bit CRC. The datasheet for the device says it needs the following CRC Definition: CRC Type Length Polynomial Direction Preset Residue CRC-CCITT 16 bits x16 + x12…
Mike
6
votes
4 answers

crc16 implementation java

I am having problems with calculating CRC-16 implementation of a byte array in java. Basically I am trying to send bytes to a RFID that starts writing to a tag. I can see the checksum value of array by looking tcpdump command on mac. But my goal is…
Ali Yucel Akgul
  • 1,101
  • 8
  • 27
  • 53
5
votes
5 answers

CRC error-correction library?

Is there a CRC library that enables the user not only detect errors but also correct them? I'm looking for a C/C++ or Java library, ideally open-source.
Gili
  • 86,244
  • 97
  • 390
  • 689
5
votes
1 answer

What, and where, is the NTFS CRC windows complains about?

I'm trying to come up with an answer for a question of mine involving recovering a file when Windows' APIs complain about a "CRC error". I know this is because of a bad block. But my theory is: If I disable S.M.A.R.T., and hence ECC, I should be…
Camilo Martin
  • 37,236
  • 20
  • 111
  • 154
5
votes
3 answers

Calculating an 8-bit CRC with the C preprocessor?

I'm writing code for a tiny 8-bit microcontroller with only a few bytes of RAM. It has a simple job which is to transmit 7 16-bit words, then the CRC of those words. The values of the words are chosen at compile time. The CRC specifically is…
Rocketmagnet
  • 5,656
  • 8
  • 36
  • 47
5
votes
4 answers

Save a CRC value in a file, without altering the actual CRC Checksum?

I am saving some Objects I have defined from my own classes, to File. (saving the stream data). That is all fine, but I would like to be able to store in the File the CRC checksum of that File. Then, whenever my Application attemps to Open a File,…
user741875