This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do --welcome to the demo please paste me into lua.org/demo | |
local g = {s="\32",k="\37\99",n="\n"} --space, uhhh???, newline | |
local data = { | |
{0x49434152,0x55532046,0x4F554E44,0x20594F55,0x21212100}, --the message | |
{0x52554E20,0x5748494C,0x4520594F,0x55204341,0x4E212121}} --encoded in 4b segs | |
local f,r,w = string.format,string.rep,io.write --wrap some funcs for smallness | |
local dc = function (data) -- de coder | |
local d,f = {},math.floor --more smallness | |
d[1] = f(data/16777216) --first byte | |
d[2] = f((data-d[1]*16777216)/65536) --the second |