CRC Hash Calculator
Free online CRC calculator supporting multiple CRC models like CRC-32, CRC-16, CRC-8, etc.
Setting
Input Setting
Code Setting
Model Setting
Input
Output
Click "Calculate CRC" button to generate result
About CRC
CRC (Cyclic Redundancy Check) algorithm
CRC is a hash function that generates a short fixed-bit check code based on data such as network data packets or computer files, which is mainly used to detect or verify errors that may occur after data transmission or storage
CRC overview
Cyclic redundancy check (CRC) is a hash function that generates a short fixed-bit check code based on data such as network packets or computer files, which is mainly used to detect or verify errors that may occur after data transmission or storage
CRC was published by W. Wesley Peterson in 1961. It uses the principle of division and remainder to detect errors
Algorithm characteristics
- Strong ability to detect sudden errors
- Hardware implementation is simple
- Fast calculations
- It is widely used in the field of data storage and data communication
- Detects the vast majority of possible errors
Advantages and limitations
Advantages:
- Powerful error detection capabilities
- Low compute overhead
- Easy to implement in hardware
Limitations:
- Not a cryptographic hash and does not provide security
- Collisions can occur (different data produce the same CRC).
CRC calculation procedure
CRC calculation example:
Assuming raw data: 11010011101100
Generate polynomials: x³ + x + 1 (binary is represented as 1011).
Calculation process:
- Add 3 zeros after the original data (because the highest order of the generated polynomial is 3) → 11010011101100000
- Use modulus 2 division by 1011
- The remainder obtained is the CRC code
// Simplified CRC calculation pseudocode
function calculateCRC(data, polynomial) {
let n = polynomial.length - 1;
let paddedData = data << n; // Add n zeros after the data
let remainder = paddedData;
while (remainder >= polynomial) {
let shift = remainder.toString(2).length - polynomial.toString(2).length;
remainder = remainder ^ (polynomial << shift);
}
return remainder;
} CRC application areas
network communication
Protocols such as Ethernet, Wi-Fi, and Bluetooth use CRC to verify the integrity of data frames
data store
Storage devices such as hard disks, optical disks, flash memory, etc. use CRC to detect data errors
file compression
ZIP, RAR, and other compression formats use CRC to verify the integrity of the decompressed data
digital communication
Digital television, satellite communication, etc. use CRC to ensure transmission quality
Commonly used CRC models
| model | polynomial | the initial value | output XOR | application scenarios |
|---|---|---|---|---|
| CRC-32 | 0x04C11DB7 | 0xFFFFFFFF | 0xFFFFFFFF | ZIP, GZIP, PNG |
| CRC-16-CCITT | 0x1021 | 0xFFFF | 0x0000 | XMODEM, Bluetooth |
| CRC-8 | 0x07 | 0x00 | 0x00 | SMBus, RFID |
| CRC-64-ECMA | 0x42F0E1EBA9EA3693 | 0x0000000000000000 | 0x0000000000000000 | ECMA-182, ISO 3309 |