$ luarocks install lua-resty-jit-uuid
This module is aimed at being a free of dependencies, performant and
complete UUID library for LuaJIT and ngx_lua.
Unlike FFI and C bindings, it does not depend on libuuid being available
in your system. On top of that, it performs better than most (all?)
of the generators it was benchmarked against, FFI bindings included.
Finally, it provides additional features such as UUID v3/v4 generation and
UUID validation.