Fix number generation in CreateUniqueId function
Replaces direct number insertion with string formatting to ensure numbers are appended as strings when generating unique IDs.
This commit is contained in:
1 parent
529c597585
commit
7b18956cbf
1 file changed
+1
-1
@@ -17,7 +17,7 @@ Ids.CreateUniqueId = function(tbl, len, pattern) -- both optional
|
||||
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
|
||||
char = math.random(1, 2) == 1 and string.char(math.random(65, 90)) or string.format("%d", math.random(10) - 1) -- CAP letter and number
|
||||
end
|
||||
id = id .. char
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user