A repository of Lua encoders and deoders for different string encodings.
-- local baseX = require 'based.X.Y'
-- Where X is the base (e.g. 32)
-- and Y is the Alphabet (e.g. Crockford's)
local base32 = require 'based.32.crockford'
local input = io.read()
local encoded = base32.encode(input)
print(encoded)
local decoded = base32.decode(input)
print(decoded)
assert(input == decoded)
Plain old 0
to F
Hexadecimal
- Crockford's
- RFC 4648
- RFC 4648 URL-Safe alphabet