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] ***************************************************************************
Afficher le fichier Open project: xianrendzw/LightFramework.Net Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
generate_crc_table ( ) : void
reflect ( ulong crc, int bitnum ) : ulong

Method Details

CRCTool() public méthode

public CRCTool ( ) : System
Résultat System

CalcCRCITT() public méthode

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
Résultat ushort

Init() public méthode

public Init ( CRCCode CodingType ) : void
CodingType CRCCode
Résultat void

crcbitbybit() public méthode

public crcbitbybit ( byte p ) : ulong
p byte
Résultat ulong

crcbitbybitfast() public méthode

public crcbitbybitfast ( byte p ) : ulong
p byte
Résultat ulong

crctable() public méthode

public crctable ( byte p ) : ulong
p byte
Résultat ulong

crctablefast() public méthode

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
Résultat ulong