什么是正在运行的 CRC?

发布于 2024-07-24 05:45:47 字数 292 浏览 4 评论 0原文

我进行了搜索,但无法找到有关它是什么以及如何计算的信息。


我不知道为什么这个问题被投了反对票。 不清楚和编程有关吗? 或者我应该问:

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

这里到底发生了什么?

I have searched and am not able to find information on what it is and how it is computed.


I have no idea why the question has been negative voted. Is it not clear and programming related? Or should I have asked:

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

What exactly happens here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

向日葵 2024-07-31 05:45:47

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

您有一个很好的示例:

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

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

从你的代码来看,我认为你已经有了一个实现,如果没有,只需谷歌搜索 CRC32。

Well, basically it's just a CRC. The word running would mean that you are supposed to calculate it on-the-fly, as the data is incoming, or that you are doing a cumulative calculation (which is the way CRC is implemented).

You have a good example:

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

Note how the $crc variable is set to 0 at the beginning, and the updated twice. The algorithm for CRC calculation uses the previously calculated CRC value and updates it. That is why it is sometimes called running CRC.

From your code I presume you already have an implementation, if not, simply google for CRC32.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文