什么是正在运行的CRC?

Ala*_*avi 5 crc32 crc

我搜索过,无法找到有关它是什么以及如何计算的信息.


我不知道为什么这个问题被否决了.是不是很清楚和编程有关?或者我应该问:

# Or you can compute the running CRC:
$crc = 0;
$crc = Archive::Zip::computeCRC32( 'abcdef', $crc );
$crc = Archive::Zip::computeCRC32( 'ghijkl', $crc );
Run Code Online (Sandbox Code Playgroud)

这到底发生了什么?

Gro*_*roo 9

好吧,基本上它只是一个CRC.运行这个词意味着你应该在运行中计算它,因为数据是传入的,或者你正在进行累积计算(这是CRC的实现方式).

你有一个很好的例子:

  # Or you can compute the running CRC:
  $crc = 0;
  $crc = Archive::Zip::computeCRC32( 'abcdef', $crc );
  $crc = Archive::Zip::computeCRC32( 'ghijkl', $crc );
Run Code Online (Sandbox Code Playgroud)

注意$crc变量在开始时如何设置为0,并且更新两次.用于CRC计算的算法使用先前计算的CRC值并对其进行更新.这就是为什么它有时被称为运行CRC.

从你的代码中我假设你已经有了一个实现,如果没有,只需google for CRC32.