user1512695
user1512695

Reputation: 79

Delphi 7 - Decode Base64 String to Byte Array

I am making a builder/stub application. The builder is coded in XE2 while the stub is coded in Delphi 7.

In XE2 when I use "EncdDecd" it has functions to encode EncodeBase64 and DecodeBase64. But in Delphi 7 when I use EncdDecd it does not have the DecodeBase64 function that I need.

In my builder I am loading a file into a stream and encoding it to a B64 AnsiString and adding it to the resources of the stub. The goal is to have the stub decode this B64 AnsiString into a byte array and ultimately write it to a file on the disk.

Upvotes: 3

Views: 7992

Answers (2)

Remy Lebeau
Remy Lebeau

Reputation: 598309

All versions of Delphi from v6 onward ship with Indy preinstalled. Its IdCoderMIME unit has TIdEncoderMIME and TIdDecoderMIME classes for encoding/decoding base64 content.

Upvotes: 2

Sean B. Durkin
Sean B. Durkin

Reputation: 12729

There is plenty of base64 free Delphi code that you can use. TurboPower LockBox 3 also has an implementation of base64. This is compilable in Delphi 7.

Upvotes: 0

Related Questions