Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 570 Bytes

readme.md

File metadata and controls

35 lines (23 loc) · 570 Bytes

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