1) Base64 Support
wget http://LuaForge. Net/frs/download. php/2664/luasocket-2.0. 2. Tar. Gz
Tar XZVF luasocket-2.0. 2. Tar. Gz
CD luasocket-2.0. 2
Make && make install
Test > Require "MIME"
> y = mime.b64 ("Diego:password")
> Print (y)
ZGLLZ286CGFZC3DVCMQ =
>
>
> z = mime.unb64 ("zgllz286cgfzc3dvcmq=")
> Print (z)
Diego:password
>
2) MD5 support
Cd/usr/local/src
wget http://LuaForge. Net/frs/download. php/2746/md5-1.1. 1. Tar. Gz
Tar xzvf md5-1.1. 1. Tar. Gz
CD md5-1.1. 1
./Configure
Make
Make install
Test > Require ' MD5 '
> y = MD5. Sumhexa ("abc")
> Print (y)
900150983cd24fb0d6963f7d28e17f72
Note that the strings encoded by the above Base64 and MD5 are related to the encoding settings of your operating system, if you encode them on another application and then decode them through LUA, notice the consistency of the codes on both systems.
Or the unified display specifies Utf-8, about Lua Utf-8 I also try.