From 7b18956cbf5f20130cc174d588b7f5fc94e9cdb6 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Sun, 19 Oct 2025 22:43:55 -0400 Subject: [PATCH] Fix number generation in CreateUniqueId function Replaces direct number insertion with string formatting to ensure numbers are appended as strings when generating unique IDs. --- lib/utility/shared/ids.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utility/shared/ids.lua b/lib/utility/shared/ids.lua index e7cdba8..06ae5e6 100644 --- a/lib/utility/shared/ids.lua +++ b/lib/utility/shared/ids.lua @@ -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