Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
exports.encode = function(txt){
return JSON.stringify({a: "hello world"}).replace(/^\{\"a\"\:\"/, "").replace(/\"\}$/, "")
}
exports.decode = function(line){
return JSON.parse('{"a": "' + line + '"}')["a"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment