{"ScriptPreparationCode":" function genHexString1(len) {\r\n return Array.from(crypto.getRandomValues(new Uint8Array(len / 2 ))).map(b =\u003E b.toString(16).padStart(2, \u00270\u0027)).join(\u0027\u0027);\r\n }\r\n\r\n function genHexString2(len) {\r\n const hex = \u00270123456789abcdef\u0027;\r\n let output = \u0027\u0027;\r\n for (let i = 0; i \u003C len; \u002B\u002Bi) {\r\n output \u002B= hex.charAt(Math.floor(Math.random() * hex.length));\r\n }\r\n return output;\r\n }\r\n\r\n function genHexString3(len) {\r\n let arr = new Uint8Array((len / 2));\r\n window.crypto.getRandomValues(arr);\r\n return Array.from(arr, dec =\u003E (\u00270\u0027 \u002B dec.toString(16)).substr(-2)).join(\u0027\u0027);\r\n }\r\n\r\n function genHexString4(len) {\r\n const hexChars = \u00270123456789abcdef\u0027;\r\n return [...Array(len)].map(() =\u003E hexChars[Math.floor(Math.random() * 16)]).join(\u0027\u0027);\r\n }\r\n\r\n function genHexString5(len) {\r\n let arr = new Uint8Array(len / 2);\r\n crypto.getRandomValues(arr);\r\n return btoa(String.fromCharCode.apply(null, arr)).replace(/[^a-f0-9]/g, \u0027\u0027).substr(0, len);\r\n }","TestCases":[{"Name":"genHexString1","Code":"const hex = genHexString1(20)","IsDeferred":false},{"Name":"genHexString2","Code":"const hex = genHexString2(20)","IsDeferred":false},{"Name":"genHexString3","Code":"const hex = genHexString3(20)","IsDeferred":false},{"Name":"genHexString4","Code":"const hex = genHexString4(20)","IsDeferred":false},{"Name":"genHexString5","Code":"const hex = genHexString5(20)","IsDeferred":false}]}