Skip to content

Instantly share code, notes, and snippets.

@Dekkonot
Dekkonot / base91.lua
Created October 14, 2019 04:29
Base91 codec for Lua
-- http://base91.sourceforge.net/
-- Based roughly on the reference implementation, though this is entirely written from scratch
-- Licensed under WTFPL (http://www.wtfpl.net/txt/copying/)
local ASSERTIONS_ENABLED = false -- Whether to run several checks when the module is first loaded
local MAKE_JSON_SAFE = false -- If this is true, " will be replaced by ' in the encoding
local CHAR_SET = [[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./:;<=>?@[]^_`{|}~"]]
local encode_CharSet = {}