C# Class DVFlasher.CRC32

Mostra file Open project: neuros/ti-uart-boot Class Usage Examples

Private Properties

Property Type Description
BuildTable void

Public Methods

Method Description
CRC32 ( ) : System

Basic Constructor to generate the standard CRC-32 (used in ethernet packets, Zip files, etc.)

CRC32 ( UInt32 KeyPoly ) : System

Basic Constructor except with a different key (divisor) polynomial

CRC32 ( UInt32 KeyPoly, UInt32 InitialRegVal, UInt32 FinalizeXorVal, System.Boolean Reflected, Int32 BytesShiftedPerCycle ) : System

Constructor for custom 32-bit CRC object - Don't use this unless you really know what the heck you are doing.

CalculateCRC ( Byte Data ) : UInt32

Calculate the CRC-32 checksum on the given array of bytes

ReflectNum ( UInt32 inVal, Int32 num ) : UInt32

Method to reflect a specified number of bits in the integer

this ( int index ) : UInt32

Private Methods

Method Description
BuildTable ( ) : void

Function to generate the table of values used in the CRC-32 calculation

Method Details

CRC32() public method

Basic Constructor to generate the standard CRC-32 (used in ethernet packets, Zip files, etc.)
public CRC32 ( ) : System
return System

CRC32() public method

Basic Constructor except with a different key (divisor) polynomial
public CRC32 ( UInt32 KeyPoly ) : System
KeyPoly System.UInt32 The user-provided key polynomial (hex number of bits[31-0])
return System

CRC32() public method

Constructor for custom 32-bit CRC object - Don't use this unless you really know what the heck you are doing.
public CRC32 ( UInt32 KeyPoly, UInt32 InitialRegVal, UInt32 FinalizeXorVal, System.Boolean Reflected, Int32 BytesShiftedPerCycle ) : System
KeyPoly System.UInt32 Custom key polynomial
InitialRegVal System.UInt32 Initial register value
FinalizeXorVal System.UInt32 Value that is xor'd with final CRC
Reflected System.Boolean Indicates whether the algorithm expects reflected input bytes
BytesShiftedPerCycle System.Int32 How many bytes are handled at a time (1 or 2). /// The internal table size is determined by this parameter, 1 is most common (leads to 1kbyte table).
return System

CalculateCRC() public method

Calculate the CRC-32 checksum on the given array of bytes
public CalculateCRC ( Byte Data ) : UInt32
Data Byte Array of bytes of data.
return System.UInt32

ReflectNum() public method

Method to reflect a specified number of bits in the integer
public ReflectNum ( UInt32 inVal, Int32 num ) : UInt32
inVal System.UInt32 The unsigned integer value input
num System.Int32 The number of lower bits to reflect.
return System.UInt32

this() public method

public this ( int index ) : UInt32
index int
return System.UInt32