|
发表于 2020-9-1 15:47:07
|
显示全部楼层
一个大牛Ross N. Williams 是这么说的:
Most CRC algorithms initialize their register to zero. However,
some initialize it to a non-zero value. In theory (i.e. with no
assumptions about the message), the initial value has no affect
on the strength of the CRC algorithm, the initial value merely
providing a fixed starting point from which the register value can
progress. However, in practice, some messages are more likely
than others, and it is wise to initialize the CRC algorithm register
to a value that does not have ”blind spots” that are likely to occur
in practice. By ”blind spot” is meant a sequence of message bytes
that do not result in the register changing its value. In particular,
any CRC algorithm that initializes its register to zero will have
a blind spot of zero when it starts up and will be unable to
”count” a leading run of zero bytes. As a leading run of zero
bytes is quite common in real messages, it is wise to initialize the
algorithm register to a non-zero value.
大多数CRC 算法把他们的寄存器初始化为0。但是,有些把它初始
化为非零值。理论上(不对信息进行任何假设),初始值的选择不影
响CRC 算法的有效性,初始值仅仅提供了一个寄存器值开始运算
的固定起点。然而,在实践中,有些信息出现的可能性要更高,因此
把CRC 寄存器初始化为一个不太可能在实际中出现“盲点” 的值
是更明智的。“盲点” 是指一系列不会导致CRC 寄存器值变化的信
息字节。特别是当CRC 寄存器被初始化为0 时就具有“零盲点”,
当它运行的时候就不知道前面有多少个零字节。而零字节在实际应
用中充当信息的前导字节是非常普遍的,所以把CRC 寄存器初始
化为非零值是一个明智的做法。
刚刚从论坛里下载的PDF里看到的。 |
|