C# Класс 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] ***************************************************************************
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
generate_crc_table ( ) : void
reflect ( ulong crc, int bitnum ) : ulong

Описание методов

CRCTool() публичный Метод

public CRCTool ( ) : System
Результат System

CalcCRCITT() публичный Метод

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
Результат ushort

Init() публичный Метод

public Init ( CRCCode CodingType ) : void
CodingType CRCCode
Результат void

crcbitbybit() публичный Метод

public crcbitbybit ( byte p ) : ulong
p byte
Результат ulong

crcbitbybitfast() публичный Метод

public crcbitbybitfast ( byte p ) : ulong
p byte
Результат ulong

crctable() публичный Метод

public crctable ( byte p ) : ulong
p byte
Результат ulong

crctablefast() публичный Метод

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
Результат ulong