Hello!
On Tue, Jul 14, 2015 at 10:18 PM, ijs wrote:
> Also, I need to compute CRC once the header and payload data is formed.
> 16-bit CRC-CCITT
> CRC-32 (used in Ethernet)
> CRC-64-ISO (HDLC)
>
> Can someone tell me how do I achieve this in LUA? Thanks a lot
Well, there is a CRC32 Lua API function provided by ngx_lua:
https://github.com/openresty/lua-nginx-module#ngxcrc32_short
Not sure if it fits your needs. For the rest, there must be some C
library providing some C API functions that you can directly call from
within your Lua code via the excellent LuaJIT FFI feature:
http://luajit.org/ext_ffi.html
It's also very fast when JIT compiled by LuaJIT.
Just my 2 cents.
Regards,
-agentzh