status refactoring

This commit is contained in:
BuckarooBanzay 2023-03-28 14:23:48 +02:00 committed by Athozus
parent 706b870b7d
commit b414ace620
No known key found for this signature in database
GPG key ID: B50895022E8484BF
9 changed files with 91 additions and 176 deletions

9
util/uuid.lua Normal file
View 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