Changes:
- Renamed 'CheckFileSHA1' function to 'CheckFileHash'.
- function prototype changes.
- Added support for MD5, SHA256(SHA-2) hash algorithms.
Code:
const
DCP_MD5 = 1;
DCP_SHA1 = 2;
DCP_SHA256 = 4; // SHA-2
Type
THashProgress = function(OverallProgress,FileProgress: Integer): Boolean;
function CheckFileHash(const Filename,HashHex: PAnsichar; PctOfTotal: integer; callback: THashProgress; DCP_Hash: integer): integer; external 'CheckFileHash@files:Isab.dll stdcall delayload';
Function return codes:
0: All OK.
-1: Hash check aborted.
-2: File hash does not match.
-3: Source File not found.
-4: Bad flag argument.