Base64

The FireflyAIO Lua API provides functions for encoding and decoding strings using Base64, a common method for representing binary data in an ASCII string format.

Base64 Encoding

To encode a string in Base64, use the Base64Encode function. This converts the input text into its Base64 encoded representation.

Here is an example:

-- Encode the string "text" in Base64
local encoded = Base64Encode("text")

In this example, the function call Base64Encode("text") will convert the string "text" to its Base64 encoded form, resulting in the value "dGV4dA==".

Base64 Decoding

To decode a Base64 encoded string back to its original form, use the Base64Decode function. This converts the Base64 encoded input back into its original string representation.

Here is an example:

-- Decode the Base64 encoded string "dGV4dA=="
local decoded = Base64Decode("dGV4dA==")

In this example, the function call Base64Decode("dGV4dA==") will convert the Base64 encoded string back to its original form, resulting in the value "text".

These functions allow you to easily handle Base64 encoding and decoding within your custom checkers in FireflyAIO, facilitating secure data transmission and storage.

Last updated