Function to convert text string to Base64 representation (using 64 symbols of ASCII only).
function EncodeBase64(sData: string): string;
Parameter |
Type |
Value |
---|---|---|
sData |
string |
source string. |
Returns encoded string in the base64 format.
const
sMessage = 'Have a nice day!';
begin
mLogScript('Original message: ' + sMessage, '');
mLogScript(EncodeBase64(sMessage), 'EncodeBase64');
end.
[23:12:42] (Log "EncodeBase64"): Original message: Have a nice day!
[23:12:42] (Log "EncodeBase64"): [EncodeBase64] SGF2ZSBhIG5pY2UgZGF5IQ==
[23:12:42] (Run "EncodeBase64"): Script operation time: 7 ms
[23:12:42] (Run "EncodeBase64"): Script done successfully.