C# Класс ImageTools.CRC32Calculator

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
CRC32Calculator ( ) : System
CalculateCrc32 ( byte buffer ) : int
CalculateCrc32 ( string inputData ) : int
Combine ( int crc, int length ) : void

Combines the given CRC32 value with the current running total.

This is useful when using a divide-and-conquer approach to calculating a CRC. Multiple threads can each calculate a CRC32 on a segment of the data, and then combine the individual CRC32 values at the end.

Reset ( ) : void

reset before reuse

SlurpBlock ( byte block ) : void
SlurpBlock ( byte block, int offset, int count ) : void

Update the value for the running CRC32 using the given block of bytes. This is useful when using the CRC32() class in a Stream.

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

Метод Описание
ComputeCrc32 ( Int32 W, byte B ) : Int32

Get the CRC32 for the given (word,byte) combo. This is a computation defined by PKzip.

_InternalComputeCrc32 ( UInt32 W, byte B ) : Int32
gf2_matrix_square ( uint square, uint mat ) : void
gf2_matrix_times ( uint matrix, uint vec ) : uint

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

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

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

CalculateCrc32() публичный статический Метод

public static CalculateCrc32 ( byte buffer ) : int
buffer byte
Результат int

CalculateCrc32() публичный статический Метод

public static CalculateCrc32 ( string inputData ) : int
inputData string
Результат int

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

Combines the given CRC32 value with the current running total.
This is useful when using a divide-and-conquer approach to calculating a CRC. Multiple threads can each calculate a CRC32 on a segment of the data, and then combine the individual CRC32 values at the end.
public Combine ( int crc, int length ) : void
crc int the crc value to be combined with this one
length int the length of data the CRC value was calculated on
Результат void

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

reset before reuse
public Reset ( ) : void
Результат void

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

public SlurpBlock ( byte block ) : void
block byte
Результат void

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

Update the value for the running CRC32 using the given block of bytes. This is useful when using the CRC32() class in a Stream.
public SlurpBlock ( byte block, int offset, int count ) : void
block byte block of bytes to slurp
offset int starting point in the block
count int how many bytes within the block to slurp
Результат void