mirror of
https://github.com/mt-mods/mail.git
synced 2025-04-30 08:21:44 -04:00
Revert util/uuid.lua changes to master
This commit is contained in:
parent
c052e5900e
commit
c4ee1bd819
1 changed files with 5 additions and 7 deletions
|
@ -1,10 +1,8 @@
|
|||
-- 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)
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue