{"ScriptPreparationCode":"function oldmeth() {\r\n function chr4 () {\r\n return Math.random().toString(16).slice(-4);\r\n }\r\n return \u0060${chr4() \u002B chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}\u0060;\r\n}\r\n\r\nfunction oldmethcrypto() {\r\n function getRandom () {\r\n return crypto.getRandomValues(new Uint32Array(4)).reduce((prev, current) =\u003E \u0060${prev.toString(16)}${current.toString(16)}\u0060);\r\n }\r\n \r\n function update4(uuid) {\r\n const fourIndx = 12;\r\n \r\n return \u0060${uuid.slice(0,12)}4${uuid.slice(13)}\u0060;\r\n }\r\n function getEight(c) {\r\n return(c ^ crypto.getRandomValues(new Uint8Array(1))[0] \u0026 15 \u003E\u003E c / 4).toString(16);\r\n }\r\n function update8(uuid) {\r\n const eightIndx = 16;\r\n return \u0060${uuid.slice(0,16)}${getEight(8)}${uuid.slice(17)}\u0060;\r\n }\r\n \r\n function addDashes(uuid) {\r\n // xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\r\n return \u0060${uuid.slice(0,8)}-${uuid.slice(8,12)}-${uuid.slice(12,16)}-${uuid.slice(16,20)}-${uuid.slice(20)}\u0060;\r\n }\r\n \r\n let uuid = getRandom();\r\n \r\n uuid = update4(uuid);\r\n \r\n uuid = update8(uuid);\r\n \r\n uuid = addDashes(uuid);\r\n \r\n return uuid;\r\n}\r\n\r\n\r\nfunction oldmethcrypto2() {\r\n function getRandom () {\r\n return crypto.getRandomValues(new Uint32Array(4)).reduce((prev, current) =\u003E \u0060${prev.toString(16)}${current.toString(16)}\u0060);\r\n }\r\n\r\n function getEight(c) {\r\n return(c ^ crypto.getRandomValues(new Uint8Array(1))[0] \u0026 15 \u003E\u003E c / 4).toString(16);\r\n }\r\n\r\n let uuid = getRandom();\r\n return \u0060${uuid.slice(0,8)}-${uuid.slice(8,12)}-4${uuid.slice(13,16)}-${getEight(8)}${uuid.slice(17,20)}-${uuid.slice(20)}\u0060;\r\n}\r\n\r\nfunction newmethrand1() {\r\n function getRandom (num) {\r\n let output;\r\n for(let i = 0; i \u003C Math.ceil(num/8); i\u002B\u002B) {\r\n output = \u0060${output}${Math.random().toString(16).slice(-8)}\u0060;\r\n }\r\n \r\n \treturn output.slice(num * -1);\r\n }\r\n\r\n function getEight(c) {\r\n return(c ^ Math.random().toString(16).slice(-1) \u0026 15 \u003E\u003E c / 4).toString(16);\r\n }\r\n\r\n let uuid = getRandom(32);\r\n return \u0060${uuid.slice(0,8)}-${uuid.slice(8,12)}-4${uuid.slice(13,16)}-${getEight(8)}${uuid.slice(17,20)}-${uuid.slice(20)}\u0060;\r\n}\r\n\r\nfunction newmeth() {\r\n return\u00A0([1e7]\u00A0\u002B\u00A0-1e3\u00A0\u002B\u00A0-4e3\u00A0\u002B\u00A0-8e3\u00A0\u002B\u00A0-1e11).replace(/[018]/g,\u00A0c\u00A0=\u003E\r\n (c\u00A0^\u00A0crypto.getRandomValues(new\u00A0Uint8Array(1))[0]\u00A0\u0026\u00A015\u00A0\u003E\u003E\u00A0c\u00A0/\u00A04).toString(16),\r\n ); \r\n}\r\n ","TestCases":[{"Name":"old old","Code":" oldmeth();","IsDeferred":false},{"Name":"new","Code":"newmeth();","IsDeferred":false},{"Name":"old crypt","Code":"oldmethcrypto();","IsDeferred":false},{"Name":"old crypt 2","Code":"oldmethcrypto2();","IsDeferred":false},{"Name":"old meth2 with random","Code":"newmethrand1();","IsDeferred":false}]}