Skip to content

A place where some of my less useful Lua modules live.

License

Notifications You must be signed in to change notification settings

NekOware/Lua-Modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua-Modules

A place where some of my less useful Lua modules live.

UUEncoding.lua

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

Features

  • Encode/Decode strings and files to and from UUEncoded format.
  • Efficient. Simple.
  • Easy-to-Use.
  • Fix all of your code issues.

Usage

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")

Links

UUEncoding.lua
Example.lua
Test.lua

Base64.lua

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

Features

  • Encode/Decode strings to and from the Base64 format.
  • Optimized. Dumb, but simple.
  • Easy-to-Use.
  • Locate the cause of your kernel panics.

Usage

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)

Links

Base64.lua
Example.lua
Test.lua

About

A place where some of my less useful Lua modules live.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages