Internet Direct (Indy) Version 9.0.2 Beta
TIdHashCRC16.HashValue
Implements calculation of the 16-bit CRC value for a block of data.

function HashValue(AStream: TStream): Word; override;
Parameters
AStream: TStream
Stream containing the data to be used for the CRC calculation.

Returns
Word - 16-bit CRC value calculated from the input data.

Description
HashValue is an overridden Word function in TIdHashCRC16 that implements calculation of the 16-bit CRC value for a block of data. HashValue reimplements the inherited method to use the pre-computed table of 16-bit CRC values for all 256 possible character combinations that can be represented in a byte from 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.