Base64 decode data: Difference between revisions

Content added Content deleted
(Add Ecstasy example)
(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag)
Line 564: Line 564:
String text = encode(bytes, pad=True);
String text = encode(bytes, pad=True);
assert text == orig;
assert text == orig;
console.println($"base64={text}, bytes={bytes}");
console.print($"base64={text}, bytes={bytes}");
}
}


Line 776: Line 776:
</syntaxhighlight>
</syntaxhighlight>


{{out}}
Output:
<pre>
<syntaxhighlight>
base64=VG8gZXJyIGlzIGh1bWFuLCBidXQgdG8gcmVhbGx5IGZvdWwgdGhpbmdzIHVwIHlvdSBuZWVkIGEgY29tcHV0ZXIuCiAgICAtLSBQYXVsIFIuIEVocmxpY2g=, bytes=0x546F206572722069732068756D616E2C2062757420746F207265616C6C7920666F756C207468696E677320757020796F75206E656564206120636F6D70757465722E0A202020202D2D205061756C20522E204568726C696368
base64=VG8gZXJyIGlzIGh1bWFuLCBidXQgdG8gcmVhbGx5IGZvdWwgdGhpbmdzIHVwIHlvdSBuZWVkIGEgY29tcHV0ZXIuCiAgICAtLSBQYXVsIFIuIEVocmxpY2g=, bytes=0x546F206572722069732068756D616E2C2062757420746F207265616C6C7920666F756C207468696E677320757020796F75206E656564206120636F6D70757465722E0A202020202D2D205061756C20522E204568726C696368
</pre>
</syntaxhighlight>


=={{header|F_Sharp|F#}}==
=={{header|F_Sharp|F#}}==