Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 7 - Decode Base64 String to Byte Array

Tags:

base64

delphi

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.

like image 449
user1512695 Avatar asked Mar 27 '26 02:03

user1512695


1 Answers

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

like image 84
Remy Lebeau Avatar answered Mar 29 '26 20:03

Remy Lebeau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!