17,230
edits
(seed random with os time so we don't get the same results for every #invoke) |
(maybe each module needs to set the seed?) |
||
Line 1: | Line 1: | ||
local p = {} | |||
function | function p.seed() | ||
math.randomseed( tonumber( tostring( os.time() ):reverse():sub( 1, 6 ) ) ) | |||
end | |||
function p.new() | |||
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' | local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' | ||
local g = string.gsub( template, '[xy]', function ( c ) | local g = string.gsub( template, '[xy]', function ( c ) | ||
Line 10: | Line 14: | ||
end | end | ||
return | return p |