String utilities and common hash functions for ngx_lua and LuaJIT