Indy 9
TIdHashCRC32
Hierarchy, Methods, See Also, Unit: IdHashCRC
Implements methods used to calculate a 32-bit CRC value for data in an input stream.
TIdHashCRC32 = class(TIdHash32)
Unit
IdHashCRC
Description
TIdHashCRC32 is a TIdHash32 descendant that implements methods used to calculate a 32-bit Cyclic Redundnacy Check (CRC) value for data in an input stream. TIdHashCRC32 uses a pre-computed 1024-byte lookup table for faster calculation of CRC values.

TIdHashCRC32.HashValue
TIdHashCRC32
Implements calculation of the 32-bit CRC value for a block of data.
function HashValue(AStream: TStream): LongWord; override;
Parameters
AStream: TStream
Stream containing the data to be used for the CRC calculation.
Return Value
Word - 32-bit CRC value calculated from the input data.
Description
HashValue is an overridden LongWord function in TIdHashCRC32 that implements calculation of the 32-bit CRC value for a block of data. HashValue reimplements the inherited method to use the pre-computed table of 32-bit CRC values for all 256 possible character combinations that can be represented by each byte in the input data. HashValue calculates the CRC result by performing an exclusive OR for the current CRC value and the precomputed CRC value in the table for low nibble of the current input data.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.