= basexx
image::https://api.travis-ci.org/aiq/basexx.png[travis]
A Lua library for base2, base16, base32, base64, base85 decoding and encoding of data strings.
== API
For every supported format has basexx a from and to function.
The from functions have two parameters:
The from functions return a string if the string can be decoded, otherwise nil and an error message.
The to functions have just one parameter:
The _toz85 function can return nil and an error message, all other functions return allways the encoded string.
=== from_bit / to_bit
Converts a byte string to a bitfield string.
=== from_hex / to_hex
Converts a byte string to a uppercase http://tools.ietf.org/html/rfc3548#section-6[hex] data string.
=== from_base32 / to_base32
Converts a byte string to a http://tools.ietf.org/html/rfc3548#section-5[base32(_rfc3548)] uppercase data string.
=== from_crockford / to_crockford
Converts a byte string to a http://www.crockford.com/wrmg/base32.html[base32(_crockford_)] uppercase data string. The optional check value is not implemented.
=== from_base64 / to_base64
Converts a byte string to a https://tools.ietf.org/html/rfc4648#section-4[base64] data string.
=== from_url64 / to_url64
Same as above, but uses a https://tools.ietf.org/html/rfc4648#section-5[URL Safe base64] alphabet and no padding.
=== from_z85 / to_z85
Converts a byte string to a http://rfc.zeromq.org/spec:32[base85(ZeroMQ)] data string. to_z85 expects only a binary string that length is divisible by 4 with no remainder, and from_z85 expects only printable a string that length is divisible by 5 with no remainder.
== Installation
To install the version 0.4.1 of basexx use LuaRocks with the following line.
If you want to use the current development version, clone this repository and use LuaRocks with the following command.