Documentation for this module may be created at Module:UUID/doc
local p = {}
function p.uuid()
math.randomseed(os.time() + tonumber(tostring({}):match("0x(.*)"), 16))
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return string.gsub(template, '[xy]', function (c)
local v = (c == 'x') and math.random(0, 0xf) or math.random(8, 0xb)
return string.format('%x', v)
end)
end
return p