{"ScriptPreparationCode":null,"TestCases":[{"Name":"uuidv4","Code":"bits = crypto.getRandomValues(new Uint8Array(20))\r\nbits[5] = (bits[5] \u0026 0x4F) | 0x40;\r\nbits[8] = (bits[8] \u0026 0xBF) | 0x80;\r\nbits = [...bits].map(e =\u003E e.toString(16).padStart(2,\u00270\u0027) ).reduce((a,c,i)=\u003Ea\u002B([4,7,10,13].includes(i)?\u0027-\u0027:c));","IsDeferred":false},{"Name":"random 1","Code":"Array(20).fill(0).map(()=\u003Ecrypto.getRandomValues(new Uint8Array(1))[0].toString(16).padStart(2,\u00270\u0027)).reduce((a,c,i)=\u003Ea\u002B([4,7,10,13].includes(i)?\u0027-\u0027:c))\r\n","IsDeferred":false},{"Name":"random 2","Code":"([1e3]\u002B-10\u002B-10\u002B-1e5).replace(/\\d/g, () =\u003E crypto.getRandomValues(new Uint8Array(1))[0].toString(16).padStart(2,\u00270\u0027))\r\n","IsDeferred":false},{"Name":"random 3","Code":"let s=[]; crypto.getRandomValues(new Uint8Array(20)).map( e =\u003E s.push(e.toString(16).padStart(2,\u00270\u0027)) ); [4,7,10,13].map( idx =\u003E s[idx]=\u0027-\u0027 ); s=s.join(\u0027\u0027);\r\n","IsDeferred":false},{"Name":"uuidv4 with join","Code":"bits = crypto.getRandomValues(new Uint8Array(20))\r\nbits[5] = (bits[5] \u0026 0x4F) | 0x40;\r\nbits[8] = (bits[8] \u0026 0xBF) | 0x80;\r\nbits = [...bits].map(e =\u003E e.toString(16).padStart(2,\u00270\u0027) );\r\n[4,7,10,13].map( idx =\u003E bits[idx]=\u0027-\u0027 ); bits = bits.join(\u0027\u0027);","IsDeferred":false}]}