Based

A repository of Lua encoders and deoders for different string encodings.

Usage

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

Currently implemented:

Base16

Plain old 0 to F Hexadecimal

Base32

  • Crockford’s

Base64

  • RFC 4648
  • RFC 4648 URL-Safe alphabet
generated by LDoc 1.4.6 Last updated 2022-10-09 10:53:02