Files
resty_functions/scripts/lib/my_uuid.lua
T

14 lines
298 B
Lua
Raw Normal View History

2023-11-06 01:30:36 +08:00
local _M = {}
function _M.uuid()
2023-11-06 01:22:29 +08:00
local uuid_cmd = "/usr/bin/uuid"
2023-11-06 01:42:22 +08:00
local handle = io.popen(uuid_cmd)
local result = handle:read("*a")
2023-11-06 01:48:22 +08:00
local r2 = string.gsub(result, "%s+", "")
local r3 = string.gsub(r2,"\n","")
ngx.log(ngx.INFO, "uuid -> ", r3)
return r3
2023-11-06 01:22:29 +08:00
end
2023-11-06 01:30:36 +08:00
return _M