CRC32 implementation on .NET Micro

﹥>﹥吖頭↗ 提交于 2019-12-02 10:35:20

.net microframework has Utility.ComputeCRC method albeit I am not sure about what algorithm actually uses. It certainly doesn't use one from OP. Utility.ComputeCRC

Try the CRC implementation from http://vbcity.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.47.04.55/CRC_5F00_Lib.zip . This is an implementation discussed at http://vbcity.com/forums/t/111345.aspx.

You can verify the correctness of your CRC calculations at http://www.lammertbies.nl/comm/info/crc-calculation.html.

The above mentioned link from vbcity discussion actually implements conversion of a c++ library given by http://www.lammertbies.nl/comm/info/crc-calculation.html.

I found this to work correctly for my CRC 16 implementation.

A short code snippet is

        ushort crcno = CRC.CRC16(stryourdata);
        Byte[] crcbytes = BitConverter.GetBytes(crcno);

You can use the code you are referring to. HashAlgorithm is just used as an Interface and you can drop it without harming the functionality of the CRC implementation itself.

Change "protected override void HashCore(byte[] buffer, int start, int length)" to "public void CalcCrc32(byte[] buffer, int start, int length)".

public uint CrcValue should return crcValue unaltered.

Drop all other methods and properties.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!