Revert util/uuid.lua changes to master

This commit is contained in:
Athozus 2024-04-05 23:01:08 +02:00
parent c052e5900e
commit c4ee1bd819
No known key found for this signature in database
GPG key ID: B50895022E8484BF

View file

@ -1,11 +1,9 @@
-- source: https://gist.github.com/jrus/3197011
local random = math.random
function mail.new_uuid()
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)
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