Delphi ActiveX
Delphi ActiveX
Compute CRC32 of a File
Calculates the CRC32 of a file's contents and returns the 32-bit CRC as a hex string.Chilkat Delphi ActiveX Downloads
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;
...
procedure TForm1.Button1Click(Sender: TObject);
var
zipCrc: TChilkatZipCrc;
crc: Integer;
hexStr: WideString;
begin
zipCrc := TChilkatZipCrc.Create(Self);
// Use a relative for absolute path to the file..
crc := zipCrc.FileCrc('qa_data/hamlet.xml');
hexStr := zipCrc.ToHex(crc);
Memo1.Lines.Add(hexStr);
end;