BASE64ENCODE$: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
m (Remove redundant See Also items) |
mNo edit summary |
||
Line 19: | Line 19: | ||
{{PageAvailability}} | {{PageAvailability}} | ||
<!-- QB64 = a version or none, QBPE = a version or all, Platforms = yes or no --> | |||
<gallery widths="48px" heights="48px" mode="nolines"> | <gallery widths="48px" heights="48px" mode="nolines"> | ||
File:Qb64.png|'''none''' | File:Qb64.png|'''none''' | ||
Line 27: | Line 28: | ||
File:Osx.png|'''yes''' | File:Osx.png|'''yes''' | ||
</gallery> | </gallery> | ||
<!-- additional availability notes go below here --> | |||
Revision as of 06:59, 26 January 2025
The _BASE64ENCODE$ function encodes a string containing binary or textual data into Base64 format.
Syntax
- encodedString$ = _BASE64ENCODE$(stringToEncode$)
Parameters
- stringToEncode$ is the string to encode in Base64 format. It can include binary or textual data.
Description
- Base64 encoding is useful for transmitting binary data in text-based systems such as email or HTTP.
- It is also helpful for sharing binary content embedded in source files on message boards and forums.
- Encoded data will only contain characters from the Base64 character set (A-Z, a-z, 0-9, +, /) with optional padding "=".
- Use _BASE64DECODE$ to reverse the operation and retrieve the original data.
Availability
Examples
- Example 1
- Encoding a string in Base64.
CONST inputString$ = "The quick brown fox jumps over the lazy dog." PRINT "Encoded string: "; _BASE64ENCODE$(inputString$) |
Encoded string: VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4= |
See also