A place where some of my less useful Lua modules live.
A module that provides functions to encode and decode strings to and from the uuencoding format.
Uuencoding is a form of binary-to-text encoding, which is primarily used to convert binary data into a format that can be easily transmitted as plain text, such as email or Usenet messages.
For more info on uuencoding: Wikipedia
- Encode/Decode strings and files to and from UUEncoded format.
-
Efficient.Simple. - Easy-to-Use.
- Fix all of your code issues.
local uu = require("uuencoding")
-- Encode a string
local encoded_string = uu.enc("Hello, World!")
-- Decode a string
local decoded_string = uu.dec(encoded_string)
-- Encode a file
local encoded_file = uu.encFile("_test_file.txt", "644")
-- Decode files from a encoded file string.
local file_count, decoded_files = uu.decFile("begin 644 _test_file.txt\n! Encoded Data !\n`\nend")
A module that provides functions to encode and decode strings to and from the base64 encoding format.
Base64 is a method of encoding any binary data in a way that can be transmitted or stored as text. It uses a set of 64 characters (hence the name "Base64") that includes letters, numbers, and symbols to represent the binary data as a series of 6-bit values. Each group of three bytes is converted into four Base64 characters, resulting in an output string that is approximately 33% larger than the original binary data. Base64 is commonly used in email, web pages, and other applications where binary data needs to be transmitted as ASCII text.
For more info on Base64: Wikipedia
- Encode/Decode strings to and from the Base64 format.
-
Optimized.Dumb, but simple. - Easy-to-Use.
- Locate the cause of your kernel panics.
local b64 = require('base64')
-- Encode a string
local encoded_string = b64.enc("Hello, World!") -- 'b64.enc' is an alias for 'b64.encode'
-- Decode a string
local decoded_string = b64.dec(encoded_string) -- 'b64.dec' is an alias for 'b64.decode'
-- Decode a string with strict mode which disallows non-base64 characters from the input string.
-- (If input string has non-base64 characters then calls an error.)
local decoded_strict = b64.dec(encoded_string, true)