api/LibBase64-1.0.lua
LibBase64.Decode(text)
Decode a Base64-encoded string into a bytestring this will raise an error if the data passed in is not a Base64-encoded string this will ignore whitespace, but not invalid characters
Parameters
- text
- a Base64-encoded string
Usage
LibBase64.Encode("SGVsbG8sIGhvdyBhcmUgeW91IGRvaW5nIHRvZGF5Pw==") == "Hello, how are you doing today?"
Return value
a bytestring
LibBase64.Encode(text, maxLineLength, lineEnding)
Encode a normal bytestring into a Base64-encoded string
Parameters
- text
- a bytestring, can be binary data
- maxLineLength
- This should be a multiple of 4, greater than 0 or nil. If non-nil, it will break up the output into lines no longer than the given number of characters. 76 is recommended.
- lineEnding
- a string to end each line with. This is "\r\n" by default.
Usage
LibBase64.Encode("Hello, how are you doing today?") == "SGVsbG8sIGhvdyBhcmUgeW91IGRvaW5nIHRvZGF5Pw=="
Return value
a Base64-encoded string
Comments