Created
January 25, 2017 20:16
-
-
Save creationix/00d31eda01bb2aaca1091666b1c39f31 to your computer and use it in GitHub Desktop.
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
local find = string.find | |
local sub = string.sub | |
local function decode(chunk) | |
local i = find(chunk, "\n", 1, true) | |
if not i then return end | |
return sub(chunk, 1, i - 1), sub(chunk, i + 1) | |
end | |
local function encode(line) | |
return line .. "\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment