C# Class Xedia.Protocol.VSCP.CRCTool

Tool to calculate and add CRC codes to a string *************************************************************************** Copyright (c) 2003 Thoraxcentrum, Erasmus MC, The Netherlands. Written by Marcel de Wijs with help from a lot of others, especially Stefan Nelwan This code is for free. I ported it from several different sources to C#. For comments: [email protected] ***************************************************************************
显示文件 Open project: grodansparadis/vscp_firmware Class Usage Examples

Public Methods

Method Description
CRCTool ( ) : System
CalcCRCITT ( byte p ) : int

CalcCRCITT is an algorithm found on the web for calculating the CRCITT checksum It is included to demonstrate that although it looks different it is the same routine as the crcbitbybit* functions. But it is optimized and preconfigured for CRCITT.

Dispose ( ) : void
Init ( CRCCode CodingType ) : void
crcbitbybit ( byte p ) : long
crcbitbybitfast ( byte p ) : long
crctable ( byte p ) : long
crctablefast ( byte p, int length ) : long

4 ways to calculate the crc checksum. If you have to do a lot of encoding you should use the table functions. Since they use precalculated values, which saves some calculating.

Private Methods

Method Description
generate_crc_table ( ) : void
reflect ( ulong crc, byte bitnum ) : ulong

Method Details

CRCTool() public method

public CRCTool ( ) : System
return System

CalcCRCITT() public method

CalcCRCITT is an algorithm found on the web for calculating the CRCITT checksum It is included to demonstrate that although it looks different it is the same routine as the crcbitbybit* functions. But it is optimized and preconfigured for CRCITT.
public CalcCRCITT ( byte p ) : int
p byte
return int

Dispose() public method

public Dispose ( ) : void
return void

Init() public method

public Init ( CRCCode CodingType ) : void
CodingType CRCCode
return void

crcbitbybit() public method

public crcbitbybit ( byte p ) : long
p byte
return long

crcbitbybitfast() public method

public crcbitbybitfast ( byte p ) : long
p byte
return long

crctable() public method

public crctable ( byte p ) : long
p byte
return long

crctablefast() public method

4 ways to calculate the crc checksum. If you have to do a lot of encoding you should use the table functions. Since they use precalculated values, which saves some calculating.
public crctablefast ( byte p, int length ) : long
p byte
length int
return long