问题描述
我正在寻找一种计算内存块校验和的方法,
我想使用一个可读的两个字符(0..9,A..Z)代表这个
校验和,所以校验和应该小于1296.我在看
crc8,它的结果是8位,那只是256,crc16'的结果是65535,
这比两个char可以容纳的更多,任何想法如何
实现这一目标?甚至不到1296,1024也可以。
谢谢,
Angelo
Hi,
I''m looking for a way to calculate a checksum for a block of memory,
I''d like to use a readable two char(0..9, A..Z) to represent this
checksum, so the checksum should be less than 1296. I''m looking at
crc8, its result is 8 bits, that''s only 256, crc16''s result is 65535,
that''s more than what the two char can accommodate, any idea how to
achieve this? even less than 1296, 1024 will do.
Thanks,
Angelo
推荐答案
所以你想要的基本上是一个CRC-10,质量不一定要高得多,因此,b $ b非常高那些规格,你不打算与其他人分享你的b $ b bCs。
我强烈怀疑CRC-10的网络搜索会对你有帮助你好。
Richard
So what you want is basically a CRC-10, and the quality won''t need to be
fabulously high since, with those specs, you''re not going to share your
CRCs with anybody else.
I strongly suspect a websearch on CRC-10 would be helpful to you.
Richard
我会使用16位或32位CRC,然后减少mod 1296.
-
Thad
I would use a 16- or 32-bit CRC and then reduce mod 1296.
--
Thad
这是一个解决方案,但理查德建议crc10,这也是一个很好的
方法,我还在搜索任何示例代码,到目前为止,没有
工作代码结果。
That''s one solution, but Richard suggests crc10, that''s a good
approach too, I''m still searching for any sample code, so far, none
working code turned out.
这篇关于在C中寻找校验和例程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!