当前位置:网站首页>[popular science] CRC verification (I) what is CRC verification?
[popular science] CRC verification (I) what is CRC verification?
2022-04-23 18:35:00 【Linest-5】
Catalog
CRC( Cyclic redundancy check )
Schematic diagram of division XOR operation
CRC( Cyclic redundancy check )
CRC(Cyclic Redundancy Check) Cyclic redundancy test , Is a technology used to detect digital data errors . As a checksum type ,CRC Generate fixed length data sets based on the construction of files or larger data sets . As far as its purpose is concerned ,CRC It's a hash function , Used to detect unexpected changes in raw computer data commonly used in storage devices such as digital telecommunications networks and hard drives .
In cyclic redundancy check , A fixed number of check bits are appended to the message to be transmitted . The data receiver receives data , And check the check bit for any errors . In Mathematics , The data receiver evaluates the additional check value by looking for the rest of the polynomial division of the transmitted content . If something seems to have gone wrong , A negative confirmation will be sent , Request retransmission of data .
Cyclic redundancy check is also applicable to storage devices such as hard disks . under these circumstances , The check bit will be assigned to each block in the hard disk . When the computer reads a corrupted or incomplete file , A cyclic redundancy error will be triggered .CRC It can come from other storage devices or CD/DVD. Common causes of errors include system crashes , The document is incomplete or damaged , Or there are many wrong files .
CRC The polynomial design depends on the length of the block that should be protected . The error protection function can also determine CRC Design . Can be used for CRC The resources implemented may have an impact on performance . understand CRC Another way is to look at a specific word in its name . Experts point out that ,CRC go by the name of “ redundancy ”, Because it increases the size of the dataset without adding new information , and “ periodic ” Because it is suitable for periodic implementation systems .
As mentioned earlier , Pointed out that CRC Is a specific type of checksum, which is also helpful , Where a data set of any size is mapped to a fixed size string , It can be called a hash function . by comparison , The checksum itself can be very simple , for example , The primitive checksum can be just the sum of the relevant byte values . Using its periodic setting CRC It is generally considered a very good strategy for checking errors and verifying data integrity . It is part of an evolving toolkit for checksum usage and hashing, as well as general file checking .
CRC Check code generation
CRC The generation of check code mainly includes the following processes :
- Find the length of the divisor , This divisor is defined by ourselves .
- The number of digits of the divisor is reduced by one to CRC The number of digits of the check code , Suppose the number of digits of the divisor is 5, Then the number of digits of the check code is 4, The number of digits of the check code is added to the divisor, that is, the number of information to be transmitted 0, If the number of digits of the check code is 4, Then add... Directly after the divisor 4 individual 0
- Perform a division operation , Add 4 individual 0 As the new divisor , Divided by the divisor we define , After the division operation is completed , You will get two results : One is business , The other is the remainder .( Be careful : The division operation adopts XOR operation )
- The remainder we get, even if we want CRC Check code
CRC Sender and receiver of
The sender
The sender gives the data to be transmitted (Data), And define polynomials (polynomial), Get... As a polynomial (n+1) Bit divisor (divisor), Add... At the end of the data n position 0, As divisor , Divide the divisor by the divisor , The remainder is what you need to calculate n position CRC Check code , What will be obtained CRC The check code is spliced to the end of the original data to generate new data , Send this data to the receiver .
The receiving party
What the receiver needs to do is simpler , Take the whole block of data as the divisor , Use the divisor obtained at the sender to remove the divisor , If the remainder of the result is 0 Words , Represents that there is no error in the transmission of data , The data obtained is correct and effective .
The receiver has another way , Even if the sender sends data and CRC data , The end party gets the data, and the end is filled with n individual 0 As divisor , Divide the divisor by a polynomial , If the remainder is the receiver's CRC Check code , How the recipient gets CRC Data and from the sender CRC In agreement , It can also be proved that there is no problem with data transmission .
Schematic diagram of division XOR operation
You can see , The message we want to convey is 100100, That is, the divisor , Our custom divisor is 1101, Its digits are 4, So add... After the divisor 3 individual 0, Then divide and XOR , The final quotient is 111101, The remainder is 001, According to the previous definition , This remainder 001 That's what we want CRC Check code .
And then what will be generated CRC The check code is added after the original divisor , That is to say 100100 Fill in the back 001 have to 100100001, This is the new data we want to send. The information contains CRC Check code , The receiver can perform corresponding analysis .
More specific CRC The calculation method of check code can refer to one digit B standing up Main teaching video
[CRC check ] Manual calculation and visual demonstration
Show the customized polynomial in the form of circuit , The original data plus the corresponding number of digits 0, Enter the circuit in turn , The final generation is what we need CRC Check code . More detailed calculation methods can be learned in the video .
版权声明
本文为[Linest-5]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231833552135.html
边栏推荐
- iptables初探
- Daily network security certification test questions (April 18, 2022)
- 实战业务优化方案总结---主目录---持续更新
- 软件测试总结
- 关于unity文件读取的操作(一)
- From introduction to mastery of MATLAB (2)
- Daily CISSP certification common mistakes (April 19, 2022)
- Linux installs MySQL in RPM (super simple)
- Test questions of daily safety network (February 2024)
- Query the logistics update quantity according to the express order number
猜你喜欢
【数学建模】—— 层次分析法(AHP)
ctfshow-web362(SSTI)
硬核解析Promise對象(這七個必會的常用API和七個關鍵問題你都了解嗎?)
Multifunctional toolbox wechat applet source code
MATLAB小技巧(6)七种滤波方法比较
From introduction to mastery of MATLAB (2)
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
Quantexa CDI(场景决策智能)Syneo平台介绍
玻璃体中的硫酸软骨素
Promote QT default control to custom control
随机推荐
Keil RVMDK compiled data type
WiFi ap6212 driver transplantation and debugging analysis technical notes
Loop path
logstash 7. There is a time problem in X. the difference between @ timestamp and local time is 8 hours
登录和发布文章功能测试
Robocode tutorial 7 - Radar locking
QT excel operation summary
On iptables
14个py小游戏源代码分享第二弹
机器学习实战 -朴素贝叶斯
Spark performance optimization guide
Use of regular expressions in QT
【ACM】509. 斐波那契数(dp五部曲)
Permission management with binary
SQL database syntax learning notes
JD freefuck Jingdong HaoMao control panel background Command Execution Vulnerability
After CANopen starts PDO timing transmission, the heartbeat frame time is wrong, PDO is delayed, and CANopen time axis is disordered
数据库上机实验四(数据完整性与存储过程)
Teach you to quickly rename folder names in a few simple steps
Daily network security certification test questions (April 13, 2022)