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