C# Class Whalin.Caching.Memcached.CRCTool

Tool to calculate and add CRC codes to a string Code found posted on CodeProject.com: http://www.codeproject.com/csharp/marcelcrcencoding.asp *************************************************************************** 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: xianrendzw/LightFramework.Net Class Usage Examples

Public Methods

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

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.

Init ( CRCCode CodingType ) : void
crcbitbybit ( byte p ) : ulong
crcbitbybitfast ( byte p ) : ulong
crctable ( byte p ) : ulong
crctablefast ( byte p ) : ulong

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, int 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 ) : ushort
p byte
return ushort

Init() public method

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

crcbitbybit() public method

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

crcbitbybitfast() public method

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

crctable() public method

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

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 ) : ulong
p byte
return ulong