client/lua: buildat.bytes(data)

This commit is contained in:
Perttu Ahola 2014-09-20 14:19:20 +03:00
parent 8939df9619
commit eb9e2ada26
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,12 @@
-- Buildat: client/init.lua
buildat = {}
function buildat.bytes(data)
local result = {}
for i=1,#data do
table.insert(result, string.byte(data, i))
end
return result
end
function buildat.dump(thing)
if type(thing) == 'string' then
return '"'..thing..'"'

View File

@ -1,6 +1,7 @@
local log = buildat.Logger("__client/sandbox")
local buildat_safe_list = {
"bytes",
"dump",
"Logger",
}