Sample code for 30+ languages & platforms
Delphi ActiveX

Base62 Encoding and Decoding

Demonstrates base62 encoding and decoding.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
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
bd: TChilkatBinData;
base62_encoded: WideString;
sb: TChilkatStringBuilder;

begin
bd := TChilkatBinData.Create(Self);

// Base62 encode.
bd.AppendString('hello world','utf-8');
base62_encoded := bd.GetEncoded('base62');
Memo1.Lines.Add('hello world --> ' + base62_encoded);

// Output: 
// hello world --> AAwf93rvy4aWQVw

// Base62 decode
sb := TChilkatStringBuilder.Create(Self);
sb.DecodeAndAppend('AAwf93rvy4aWQVw','base62','utf-8');
Memo1.Lines.Add('decoded: ' + sb.GetAsString());

// Output:
// decoded: hello world
end;