mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-15 18:56:47 -04:00
status refactoring
This commit is contained in:
parent
706b870b7d
commit
b414ace620
9 changed files with 91 additions and 176 deletions
9
util/uuid.lua
Normal file
9
util/uuid.lua
Normal file
|
@ -0,0 +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)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue