Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kan18/7e187dc686cfbf90d607e1bc4f07e2f6 to your computer and use it in GitHub Desktop.
Save Kan18/7e187dc686cfbf90d607e1bc4f07e2f6 to your computer and use it in GitHub Desktop.
lua hex <= => string
function fromhex(str) return (str:gsub('..', function (cc) return string.char(tonumber(cc, 16)) end)) end
function tohex(str) return (str:gsub('.', function (c) return string.format('%02X', string.byte(c))end)) end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment