Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a running CRC?

Tags:

crc

crc32

I have searched and am not able to find information on what it is and how it is computed.


I have no idea why the question has been negative voted. Is it not clear and programming related? Or should I have asked:

# Or you can compute the running CRC:
$crc = 0;
$crc = Archive::Zip::computeCRC32( 'abcdef', $crc );
$crc = Archive::Zip::computeCRC32( 'ghijkl', $crc );

What exactly happens here?

like image 678
Alan Haggai Alavi Avatar asked Jun 08 '09 10:06

Alan Haggai Alavi


People also ask

How a CRC is calculated?

The theory of a CRC calculation is straight forward. The data is treated by the CRC algorithm as a binary num- ber. This number is divided by another binary number called the polynomial. The rest of the division is the CRC checksum, which is appended to the transmitted message.

What is a CRC calculation unit?

The CRC calculation unit has a single 32-bit read/write data register (CRC_DR). It is used to input new data (write access) and hold the result of the previous CRC calculation (read access). Each write operation to the data register creates a combination of the previous CRC value (stored in CRC_DR) and the new one.

What is CRC 32?

CRC32 is an error-detecting function that uses a CRC32 algorithm to detect changes between source and target data. The CRC32 function converts a variable-length string into an 8-character string that is a text representation of the hexadecimal value of a 32 bit-binary sequence.

What is CRC in microcontroller?

A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to digital data. Blocks of data entering these systems get a short check value attached, based on the remainder of a polynomial division of their contents.


1 Answers

Well, basically it's just a CRC. The word running would mean that you are supposed to calculate it on-the-fly, as the data is incoming, or that you are doing a cumulative calculation (which is the way CRC is implemented).

You have a good example:

  # Or you can compute the running CRC:
  $crc = 0;
  $crc = Archive::Zip::computeCRC32( 'abcdef', $crc );
  $crc = Archive::Zip::computeCRC32( 'ghijkl', $crc );

Note how the $crc variable is set to 0 at the beginning, and the updated twice. The algorithm for CRC calculation uses the previously calculated CRC value and updates it. That is why it is sometimes called running CRC.

From your code I presume you already have an implementation, if not, simply google for CRC32.

like image 192
Groo Avatar answered Oct 19 '22 08:10

Groo