gpt4 book ai didi

file - CRC32真的对文件完整性检查不好吗?

转载 作者:行者123 更新时间:2023-12-04 10:55:24 25 4
gpt4 key购买 nike

当然,MD5比CRC32更好,SHA1比MD5更好,依此类推...但是它们也比CRC32慢得多。

正确的知道,我正在考虑如何检查正在传输的文件的一致性,而CRC32是最快的选择。

我在任何地方都没有发现 CRC32对完整性检查有多严重(也许换句话说,CRC32不会检测格式错误的文件)?

最佳答案

引用http://www.mathpages.com/home/kmath458.htm:

So, if we assume that any corruption of our data affects our string in a completely random way, i.e., such that the corrupted string is totally uncorrelated with the original string, then the probability of a corrupted string going undetected is 1/(2^n). This is the basis on which people say a 16-bit CRC has a probability of 1/(2^16) = 1.5E-5 of failing to detect an error in the data, and a 32-bit CRC has a probability of 1/(2^32), which is about 2.3E-10 (less than one in a billion).



我的看法:CRC-32足以检测错误。它被广泛使用。但是,当您要将其用作“哈希函数”时,它并不安全。

关于file - CRC32真的对文件完整性检查不好吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10371858/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com