Delphi ActiveX
Delphi ActiveX
Example: Crypt2.CrcBd method
Demonstrates how to call the CrcBd method.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
crypt: TChilkatCrypt2;
bd: TChilkatBinData;
crc32: Cardinal;
crc8: Cardinal;
begin
crypt := TChilkatCrypt2.Create(Self);
bd := TChilkatBinData.Create(Self);
bd.AppendString('123456789','us-ascii');
crc32 := crypt.CrcBd('crc-32',bd.ControlInterface);
// The decimal value is 3421780262 (converted to hex is 0xCBF43926)
Memo1.Lines.Add(IntToStr(crc32));
crc8 := crypt.CrcBd('crc8',bd.ControlInterface);
Memo1.Lines.Add(IntToStr(crc8));
end;