mirror of
https://github.com/appgurueu/modlib.git
synced 2024-12-23 05:42:28 +01:00
Add text.hexdump
This commit is contained in:
parent
63050f3bad
commit
2ff48fe494
7
text.lua
7
text.lua
@ -62,6 +62,13 @@ function inputstream(text)
|
||||
return setmetatable({text = text, cursor = 0}, inputstream_metatable)
|
||||
end
|
||||
|
||||
function hexdump(text)
|
||||
local dump = {}
|
||||
for index = 1, text:len() do
|
||||
dump[index] = ("%02X"):format(text:byte(index))
|
||||
end
|
||||
return table.concat(dump)
|
||||
end
|
||||
|
||||
function split(text, delimiter, limit, is_regex)
|
||||
limit = limit or math.huge
|
||||
|
Loading…
Reference in New Issue
Block a user