A Hex Encoder

--

Photo by Celso Oliveira on Unsplash

LuaHexEncoder is written in Lisp. The purpose of the utility is to convert a text from ASCII to hex. Many utilities do that, but this is Lua-compatible.

To use it, you have to provide the following:

1. The input file
2. The output file
3. The length of each line

(encode “input.txt” “output.txt” 42)

For example, if this is your input file.

<![CDATA[
Hello world
]]>

The output file after processing.

\x3C\x21\x5B\x43\x44\x41\x54\x41\x5B\x0A\z                             \x48\x65\x6C\x6C\x6F\x20\x77\x6F\x72\x6C\z                             \x64\x0A\x5D\x5D\x3E\z

The code of the utility:

--

--

No responses yet