C# Class ImageTools.CRC32Calculator

Afficher le fichier Open project: prepare/HTML-Renderer Class Usage Examples

Méthodes publiques

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

Private Methods

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

Method Details

CRC32Calculator() public méthode

public CRC32Calculator ( ) : System
Résultat System

CalculateCrc32() public static méthode

public static CalculateCrc32 ( byte buffer ) : int
buffer byte
Résultat int

CalculateCrc32() public static méthode

public static CalculateCrc32 ( string inputData ) : int
inputData string
Résultat int

Combine() public méthode

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

Reset() public méthode

reset before reuse
public Reset ( ) : void
Résultat void

SlurpBlock() public méthode

public SlurpBlock ( byte block ) : void
block byte
Résultat void

SlurpBlock() public méthode

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