{"ScriptPreparationCode":"function makehex(bytelength=1024){\r\n let i=-1,hex=\u0027\u0027;\r\n while(\u002B\u002Bi\u003Cbytelength){\r\n hex\u002B=(Math.random()*100|0).toString(16).padStart(2,\u00270\u0027);\r\n }\r\n return hex\r\n}\r\n\r\nvar hex10kb=makehex(1024*10)\r\n\r\nfunction bytes_fromhex1(hex){//https://measurethat.net/Benchmarks/Show/107/4/parse-hex-to-bytes\r\n\tvar bin = [], i, c, isEmpty = 1, buffer;\r\n\tfor(i = 0; i \u003C hex.length; i\u002B\u002B){\r\n\t\tc = hex.charCodeAt(i);\r\n\t\t//if(c \u003E 47 \u0026\u0026 c \u003C 58 || c \u003E 64 \u0026\u0026 c \u003C 71 || c \u003E 96 \u0026\u0026 c \u003C 103){\r\n\t\t\tbuffer = buffer \u003C\u003C 4 ^ (c \u003E 64 ? c \u002B 9 : c) \u0026 15;\r\n\t\t\tif(isEmpty ^= 1){\r\n\t\t\t\tbin.push(buffer \u0026 0xff);\r\n\t\t\t}\r\n\t\t//}\r\n\t}\r\n\treturn new Uint8Array(bin);\r\n}\r\n\r\nfunction bytes_fromhex1_nocheck(s){//do some change\r\n let i=-1,n=s.length,e=1,l=new Uint8Array(n/2);\r\n let c,b;\r\n while(\u002B\u002Bi\u003Cn){\r\n c=s.charCodeAt(i);\r\n \tb=b\u003C\u003C4^(c\u003E64?c\u002B9:c)\u002615;\r\n if(e^=1){l[i\u003E\u003E1]=b\u00260xff};\r\n }\r\n return l\r\n}\r\n\r\nfunction bytes_fromhex2(input){\r\n let i=-1,len=input.length,output=new Uint8Array(len/2);\r\n let v1,v2;\r\n while(\u002B\u002Bi\u003Clen){\r\n v1=input.charCodeAt(i);\r\n v2=input.charCodeAt(\u002B\u002Bi);\r\n v1-=v1\u003C58?48:v1\u003C71?55:87;\r\n v2-=v2\u003C58?48:v2\u003C71?55:87;\r\n output[i\u003E\u003E1]=(v1\u003C\u003C4)\u002Bv2;\r\n };\r\n return output\r\n}\r\n\r\n/*\r\nif((bytes_fromhex1(hex10kb).toString()==bytes_fromhex1_nocheck(hex10kb).toString())\u0026\u0026\r\n(bytes_fromhex2(hex10kb).toString()==bytes_fromhex1_nocheck(hex10kb).toString()))\r\n{console.log(\u002710kbok\u0027)}\r\n*/","TestCases":[{"Name":"bytes_fromhex1_10kb","Code":"bytes_fromhex1(hex10kb);","IsDeferred":false},{"Name":"bytes_fromhex1_nocheck_10kb","Code":"bytes_fromhex1_nocheck(hex10kb);","IsDeferred":false},{"Name":"bytes_fromhex2_10kb","Code":"bytes_fromhex2(hex10kb);","IsDeferred":false}]}