1 file changed
+2
-1
+2
-1
@@ -8,7 +8,8 @@ Ids.CreateUniqueId = function(tbl, len, pattern) -- both optional
|
||||
for i = 1, len do
|
||||
local char = ""
|
||||
if pattern then
|
||||
char = pattern:sub(math.random(1, #pattern), math.random(1, #pattern))
|
||||
local charIndex = math.random(1, #pattern)
|
||||
char = pattern:sub(charIndex, charIndex)
|
||||
else
|
||||
char = math.random(1, 2) == 1 and string.char(math.random(65, 90)) or math.random(0, 9) -- CAP letter and number
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user