View Single Post
  #13  
Old 12-02-2016, 11:43
peterf1999's Avatar
peterf1999 peterf1999 is offline
Die Hard Member
 
Join Date: Nov 2008
Location: Italy
Posts: 928
Thanks: 14
Thanked 983 Times in 236 Posts
peterf1999 is on a distinguished road
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.

Last edited by peterf1999; 14-02-2016 at 09:28.
Reply With Quote
The Following 5 Users Say Thank You to peterf1999 For This Useful Post:
altef_4 (12-02-2016), arkantos7 (12-02-2016), Carldric Clement (13-02-2016), Razor12911 (17-02-2016), y_thelastknight (07-04-2016)