F_BA_CmpHash

F_BA_CmpHash 1:

F_BA_CmpHash detects changes in data by comparing hashes. This function calculates a hash value for the input data and compares it to a stored hash value. If the hash values are different, the data has changed.

F_BA_CmpHash 2:

Advantage: No redundant storage is required.

Disadvantage: About 3 times slower than a direct memory comparison. Recommended use: When comparing small data blocks.

Syntax

FUNCTION F_BA_CmpHash : BOOL
VAR_INPUT
  pData     : PVOID;
  nSize     : UINT;
END_VAR
VAR_IN_OUT
  nHash     : DWORD;
END_VAR

F_BA_CmpHash 3: Inputs

Name

Type

Description

pData

PVOID

Pointer to the data to be checked.

nSize

UINT

Size of the data in bytes.

F_BA_CmpHash 4: Inputs/outputs

Name

Type

Description

nHash

DWORD

Stored hash value (updated when a change is detected)