Delphi ActiveX
Delphi ActiveX
Decode Base64
Demonstrates how to decode base64.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
success: Integer;
bd: TChilkatBinData;
password: WideString;
begin
success := 0;
bd := TChilkatBinData.Create(Self);
// Append a base64 string to bd.
success := bd.AppendEncoded('c2VjcmV0','base64');
// The bd now contains the decoded bytes.
// Let's say it was a password string..
password := bd.GetString('utf-8');
// Decodes to "secret".
Memo1.Lines.Add('password = ' + password);
end;