Creating cylic redundancy check number for a file in linux

CRC stands for Cylic Redudancy Check.

According to wikipedia

A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data. Blocks of data entering these systems get a short check value attached, based on the remainder of a polynomial division of their contents. On retrieval the calculation is repeated, and corrective action can be taken against presumed data corruption if the check values do not match.


So CRC is used when we want to ensure that the data being transmitted is error free. Now there are a number of methods to calculate the CRC and different types of CRC which ware listed out in the above mentioned CRC link of wikipedia.

Linux provides a simple command to find the CRC with out bothering about the mathematical details of the CRC calculation.

The command to calculate CRC of a text file is CRC32

The syntax is simple

Let us say we have a file called hello with the contents

Please note that as many times as you run the command, the CRC32 will remain the same as long as there is no change in the file. Note that even a space in the file change the CRC32.

No comments:

Post a Comment

Follow by Email