Base64


 

Base64>source,ENCODE|DECODE[,target]

 

Encodes or decodes source to target using Base64.  Base64 encodes data using pure ASCII characters.  It is therefore ideal for storing binary data in text files etc and is commonly used for sending binary attachments in email.  

 

By default Base64 works with ANSI strings only.  To enable encoding/decoding of Unicode strings set BASE64_UNICODE to 1 first.

 

This function is most useful when used with the Crypt function.  Crypt results in binary data, so Base64 can be used to encode that binary data to a plain text string which can then safely be stored in a text file or database.

 

Abbreviation: Bas

See also: Crypt

 

Example

 

Crypt>abc,hello,cryptval

Base64>cryptval,ENCODE,ascii_cryptval

WriteLn>d:\test.txt,r,ascii_cryptval

 

..

 

ReadLn>d:\test.txt,1,ascii_cryptval

Base64>ascii_cryptval,DECODE,bin_cryptval

Crypt>abc,bin_cryptval,clean