Skip to content

DarkWiiPlayer/based

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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