Function to convert text string to Base64 representation (using 64 symbols of ASCII only).

 

Syntax

function EncodeBase64(sData: string): string;

 

Parameters and return values

Parameter

Type

Value

sData

string

source string.

 

Function result

Returns encoded string in the base64 format.

 

Example

const
  sMessage = 'Have a nice day!';
begin
  mLogScript('Original message: ' + sMessage, '');
  mLogScript(EncodeBase64(sMessage), 'EncodeBase64');
end.

Script work result

[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.
 

See also

mLogScript