strDecode64 (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


strDecode64 will decode a string that is encoded in base64.

 

Note that the returned string is a dynamic string.

 

Input:

str : STRING

A base64-encoded string.

 

Returns: STRING

The decoded string.

 

Declaration:

FUNCTION strDecode64 : 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;