英文:
Very basic understanding on CRC algorithm. Length? Divisor?
问题
Question1: 在CRC算法中,你应该将[000]
附加到[01001000]
的末尾,然后执行"XOR loop",重复相同的操作来处理其余的12个字符* 8位切割的[ar3]
以生成不同的13个CRC校验和。
Question2: 选择一个好的divisor
通常涉及数学计算和分析。一般情况下,有一些常用的多项式,但具体取决于你的数据和需求。你可能需要通过分析[sz2]
来获得一个适合的divisor
。
Question3: 如果"HELLO"
的"H"
以[0100....]
开始,而除数是[1011]
,那么XOR的结果确实是[1111]
。接下来,你将继续将除数与结果的下一位进行XOR操作,以便逐步处理整个数据块。
希望这些回答能帮助你更好地理解CRC算法。如果你需要更多详细信息,请随时提问。
英文:
Thank you for clicking my question.
I want to understand the CRC algorithm from the scratch.
I tried to read basic articles from Wikipedia and etc... but failed in some detailed points.
So, let me show one practical example case.
When we have to transfer the string "HELLO WORLD!\0"
(let me call it as [sz2]
) through the network,
also have to verify with CRC...
The [sz2]
's binary value should be like below: (and let me call it as [ar3]
.)
[01001000010001010100110001001100010011110010000001010111010011110101001001001100010001000010000100000000]
Then, gotta perform a loop code to traverse [ar3]
.
The first character is 'H' and binary is [01001000]
Question1 : Shall i append [000]
at the end of [01001000]
and perform "XOR loop", then repeat the same job to the rest 12characters * 8bits chopped [ar3]
to make different 13 CRC checksums?
Or, append [000..]
at the end of [sz2]
and perform the long traversing loop?
Question2 : How to choose good divisor
? what is adjacent polynomial for this case [sz2]
?
Is there "commonly used polynomial" in general? Or, do we have to calculate through [sz2]
to acquire good one?
Question3 : Many explanation contents gives target binary starting with [1...]
.
But as you can see "HELLO"
's "H"
is starting with [0100....]
.
then, if the divisor is [1011]
, result of XOR becomes [1111]
. What should be the next calculation?
Please teach me master hands; Thank you in advance.
答案1
得分: 2
- 在整个消息的末尾添加三个零一次。
1011
已经在度数为四的CRC中广泛使用,例如在 ITU-T G.704 中。您可以在 Koopman 的网站 上找到不同消息长度的分析。- 不,如果高位为零,就没有异或操作。第一步的结果是
01001000010...
。在下一步中有1
,之后结果是00010000010...
。
英文:
- You append the three zeros once at the end of the entire message.
1011
has been in common use for a degree-four CRC, e.g. in ITU-T G.704. You can find an analysis for different message lengths on Koopman's site.- No, if the high bit is zero, there is no exclusive-or. The result of the first step is
01001000010...
. At the next step there is1
, after which the result is00010000010...
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论