|
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.
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.) |
Success | P6R::eOk | |
Failure | P6R::eAlreadyInitialized | The call is ignored. |