fixed id patterns

math.random was being picked twice for the pattern select instead of using char digit at some location
This commit is contained in:
gononono64 committed 2025-03-02 23:23:18 -06:00
1 parent e13c623d4b
commit f947637316
1 file changed
+2 -1
+2 -1
View File
@@ -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