Jump to content

Base64 decode data: Difference between revisions

Ada using AWS added
(Ada using AWS added)
Line 6:
 
When working on the VBA implementation I found several 'solutions' on the net, including one from the software maker himself, that showed output with incorrect padding. Obviously with incorrect padding in the output you can not decode correctly to the original file again.
 
=={{header|Ada}}==
<lang Ada>with Ada.Text_IO;
 
with AWS.Translator;
 
procedure Decode_AWS is
Input : constant String :=
"VG8gZXJyIGlzIGh1bWFuLCBidXQgdG8gcmVhbGx5IGZvdWwgdGhpbmdzIHVw" &
"IHlvdSBuZWVkIGEgY29tcHV0ZXIuCiAgICAtLSBQYXVsIFIuIEVocmxpY2g=";
Result : constant String := AWS.Translator.Base64_Decode (Input);
begin
Ada.Text_IO.Put_Line (Input);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line (Result);
end Decode_AWS;</lang>
 
{{out}}
<pre>VG8gZXJyIGlzIGh1bWFuLCBidXQgdG8gcmVhbGx5IGZvdWwgdGhpbmdzIHVwIHlvdSBuZWVkIGEgY29tcHV0ZXIuCiAgICAtLSBQYXVsIFIuIEVocmxpY2g=
 
To err is human, but to really foul things up you need a computer.
-- Paul R. Ehrlich</pre>
 
 
=={{header|Arturo}}==
211

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.