Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6ICRC32::initialize ( P6CRC32FLAGS  flags,
P6UINT32  polynomial,
P6UINT32  initValue,
P6UINT32  finalXOR,
P6BOOL  reflected 
)
pure virtual

This function ensures that this object is in its proper initial state.

In most cases, the caller will simply set the parameter useDefaults to P6TRUE and be done. The result is that the 0x04C11DB7 polynomial is used (which is used in PKZIP and Ethernet). However, if the caller wishes to use another 32 bit polynomial then the remaining parameters must be set. The description of the polynomial should define how the remaining parameters are to be set.

Parameters
flags[ in ] Set perferences for the new object.
polynomial[ in ] hexadecimal representation of the desired polynomial, for example
* 16 12 5 16
* X + X + X + 1 is represented as 0x1021, where X is assumed and the
* remaining coefficients are ones in the number:
* 12 11 10 98 7654 3210
* 0001 0 0 00 0010 0001 (bits 12, 5, and 0 are set to 1).
*
initValue[ in ] hexadecimal value, initialize the CRC register with this value
finalXOR[ in ] hexadecimal value, XOR this value with the final computed CRC value
reflected[ in ] Some polynomials require the CRC shift register to shift bits right instead of left. To do this requires the reflected algorthm to be on (e.g., the default CRC32 polynomial uses this mode.)
Returns
SuccessP6R::eOk 
FailureP6R::eAlreadyInitializedThe call is ignored.