strEncode64 (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


strEncode64 will encode a string by using base 64.

 

Note that the returned string is a dynamic string.

 

Input:

str : STRING

The string to encode.

 

Returns: STRING

The string encoded in base 64.

 

Declaration:

FUNCTION strEncode64 : STRING;
VAR_INPUT
  str : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  str_src : STRING;
  str_enc : STRING;
  str_dec : STRING;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
  str_src := "Aladdin:open sesame";
  str_enc := strEncode64(str:=str_src);
  str_dec := strDecode64(str:=str_enc);
  // srt_enc = "QWxhZGRpbjvcGVuIHNlc2FtZQ=="
  // str_dec = "Aladdin:open sesame"
  ...
END;
 
END_PROGRAM;