Method | Description | |
---|---|---|
CRC32 ( ) : System |
Create an instance of the CRC32 class using the default settings: no bit reversal, and a polynomial of 0xEDB88320.
|
|
CRC32 ( bool reverseBits ) : System |
Create an instance of the CRC32 class, specifying whether to reverse data bits or not. In the CRC-32 used by BZip2, the bits are reversed. Therefore if you want a CRC32 with compatibility with BZip2, you should pass true here. In the CRC-32 used by GZIP and PKZIP, the bits are not reversed; Therefore if you want a CRC32 with compatibility with those, you should pass false. |
|
CRC32 ( int polynomial, bool reverseBits ) : System |
Create an instance of the CRC32 class, specifying the polynomial and whether to reverse data bits or not. In the CRC-32 used by BZip2, the bits are reversed. Therefore if you want a CRC32 with compatibility with BZip2, you should pass true here for the |
|
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. |
|
ComputeCrc32 ( |
Get the CRC32 for the given (word,byte) combo. This is a computation defined by PKzip for PKZIP 2.0 (weak) encryption.
|
|
GetCrc32 ( System input ) : |
Returns the CRC32 for the specified stream.
|
|
GetCrc32AndCopy ( System input, System output ) : |
Returns the CRC32 for the specified stream, and writes the input into the output stream.
|
|
Reset ( ) : void |
Reset the CRC-32 class - clear the CRC "remainder register." Use this when employing a single instance of this class to compute multiple, distinct CRCs on multiple, distinct data blocks. |
|
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.
|
|
UpdateCRC ( byte b ) : void |
Process one byte in the CRC.
|
|
UpdateCRC ( byte b, int n ) : void |
Process a run of N identical bytes into the CRC. This method serves as an optimization for updating the CRC when a run of identical bytes is found. Rather than passing in a buffer of length n, containing all identical bytes b, this method accepts the byte value and the length of the (virtual) buffer - the length of the run. |
Method | Description | |
---|---|---|
GenerateLookupTable ( ) : void | ||
ReverseBits ( byte data ) : byte | ||
ReverseBits ( uint data ) : uint | ||
_InternalComputeCrc32 ( |
||
gf2_matrix_square ( uint square, uint mat ) : void | ||
gf2_matrix_times ( uint matrix, uint vec ) : uint |
public CRC32 ( bool reverseBits ) : System | ||
reverseBits | bool | /// specify true if the instance should reverse data bits. /// |
return | System |
public CRC32 ( int polynomial, bool reverseBits ) : System | ||
polynomial | int | /// The polynomial to use for the CRC, expressed in the reversed (LSB) /// format: the highest ordered bit in the polynomial value is the /// coefficient of the 0th power; the second-highest order bit is the /// coefficient of the 1 power, and so on. Expressed this way, the /// polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. /// |
reverseBits | bool | /// specify true if the instance should reverse data bits. /// |
return | System |
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 |
return | void |
public ComputeCrc32 ( |
||
W | The word to start with. | |
B | byte | The byte to combine it with. |
return |
public GetCrc32 ( System input ) : |
||
input | System | The stream over which to calculate the CRC32 |
return |
public GetCrc32AndCopy ( System input, System output ) : |
||
input | System | The stream over which to calculate the CRC32 |
output | System | The stream into which to deflate the input |
return |
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 |
return | void |
public UpdateCRC ( byte b ) : void | ||
b | byte | the byte to include into the CRC . |
return | void |
public UpdateCRC ( byte b, int n ) : void | ||
b | byte | the byte to include into the CRC. |
n | int | the number of times that byte should be repeated. |
return | void |