ToBase64()
Calculates the Base64 representation of a string or binary object.
The Base64 format uses printable characters, allowing binary data to be sent in forms and e-mail, and stored in a database or file.
ToBase64( strOrBin=any, encoding=string );
Returns: String
| Argument | Description |
|---|---|
|
strOrBin
any,
required
|
edit
A string, the name of a string, or a binary object. Alias: string, BinaryData |
|
encoding
string,
optional
|
edit
For a string, defines how characters are represented in a byte array. |
Examples
editdump(ToBase64("ToBase64")); // VG9CYXNlNjQ=
See also
- Encode/Decode
- Binary data
- ImageReadBase64()
- ImageWriteBase64()
- ToBinary()
- string.toBase64()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)