initial version, imported from http://smherwig.blogspot.fr/2013/05/a-simple-binascii-module-in-ruby-and-lua.html