UUID Lua
In this post, we will write a UUID generator in lua programming language.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
In this post, we will write a UUID generator in lua programming language.
local function getUUID()
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return string.gsub(template, '[xy]', function (c)
local v = (c == 'x') and random(0, 0xf) or random(8, 0xb)
return string.format('%x', v)
end)
end
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Comments
Post a Comment