base64.encode

From RPTools Wiki
Revision as of 15:12, 20 April 2019 by Phergus (talk | contribs) (Created page with "{{MacroFunction |name=base64.encode |trusted=false |version=1.5.2 |description= Takes the supplied text string and encodes it to [https://en.wikipedia.org/wiki/Base64 Base64]....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

base64.encode() Function

Introduced in version 1.5.2
Takes the supplied text string and encodes it to Base64.

Usage

base64.encode(string)

Parameters

  • string - The text string to be encoded.

Example

Encode a string and then decode it.
[r: txt = "Four score and seven years ago..."]<br>
[r: encTxt = base64.encode(txt)]<br>
[r: base64.decode(encTxt)]<br>

Returns:

Four score and seven years ago... 
Rm91ciBzY29yZSBhbmQgc2V2ZW4geWVhcnMgYWdvLi4u 
Four score and seven years ago...

See Also