{"ScriptPreparationCode":"\r\n function simpleUid() {\r\n return Math.random().toString(36).substring(2, 15) \u002B Math.random().toString(36).substring(2, 15);\r\n }\r\n \r\n function uuid4() {\r\n return \u0027xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\u0027.replace(/[xy]/g, function(c) {\r\n let r = Math.random() * 16 | 0;\r\n let v = c === \u0027x\u0027 ? r : (r \u0026 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n }\r\n\r\nfunction generateUniqueId(length) {\r\n let result = \u0027\u0027;\r\n const characters = \u0027ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\u0027;\r\n const charactersLength = characters.length;\r\n\r\n for (let i = 0; i \u003C length; i\u002B\u002B) {\r\n result \u002B= characters.charAt(Math.floor(Math.random() * charactersLength));\r\n }\r\n\r\n return result;\r\n}\r\n\r\nfunction simpleUidL(length) {\r\n let result = \u0027\u0027;\r\n while (result.length \u003C length) {\r\n result \u002B= Math.random().toString(36).substring(2, 15);\r\n }\r\n return result.substring(0, length);\r\n}","TestCases":[{"Name":"Simple Uid","Code":"let uid = simpleUid();","IsDeferred":false},{"Name":"UUID4","Code":"let uid = uuid4();","IsDeferred":false},{"Name":"Variable length uid","Code":"let uid = generateUniqueId(21);","IsDeferred":false},{"Name":"Simple UID with variable length","Code":"let uid = simpleUidL();","IsDeferred":false}]}