{"ScriptPreparationCode":"var n = 80000;\r\nvar arr = new Uint8Array(n);\r\nfor (let i = 0; i \u003C n; \u002B\u002Bi) {\r\n arr[i] = (Math.random() * 255) | 0;\r\n}\r\n\r\n\r\nconst CP437 = \u0022\\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\u00B6\u00A7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\\\u0022#$%\u0026\u0027()*\u002B,-./0123456789:;\u003C=\u003E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_\u0060abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00C7\u00FC\u00E9\u00E2\u00E4\u00E0\u00E5\u00E7\u00EA\u00EB\u00E8\u00EF\u00EE\u00EC\u00C4\u00C5\u00C9\u00E6\u00C6\u00F4\u00F6\u00F2\u00FB\u00F9\u00FF\u00D6\u00DC\u00A2\u00A3\u00A5\u20A7\u0192\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA\u00BF\u2310\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\u00DF\u0393\u03C0\u03A3\u03C3\u00B5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\u00B1\u2265\u2264\u2320\u2321\u00F7\u2248\u00B0\u2219\u00B7\u221A\u207F\u00B2\u25A0 \u0022.split(\u0022\u0022);\r\nfunction convert_in_place(s)\r\n{\r\n\tfor (let k = 0; k \u003C s.length; k\u002B\u002B)\r\n\t\ts[k] = CP437[s[k]];\r\n\treturn s;\r\n}\r\nfunction convert(buf)\r\n{\r\n\treturn convert_in_place(buf.slice());\r\n}\r\n\r\nfunction decodeAppend(buf)\r\n{\r\n\tlet result = \u0022\u0022;\r\n\tfor (let indexCharacter = 0; indexCharacter \u003C buf.length; indexCharacter\u002B\u002B) {\r\n\t\tresult \u002B= CP437[buf[indexCharacter]];\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nfunction decodeFromCharCode(buf)\r\n{\r\n\tconst s = convert(buf);\r\n\treturn String.fromCharCode.apply(null, s);\r\n}\r\n\r\nfunction decodeFromCharCode2(buf, chunk)\r\n{\r\n\tlet str = \u0022\u0022;\r\n\tlet pad = new Uint8Array(chunk);\r\n\tfor(let k = 0; k \u003C buf.length; k \u002B= chunk)\r\n\t{\r\n\t\tconst remaining = buf.length - k;\r\n\t\tfor (let i = 0; i \u003C Math.min(chunk, remaining); i\u002B\u002B)\r\n\t\t\tpad[i] = CP437[buf[k \u002B i]];\r\n\t\tstr \u002B= String.fromCharCode.apply(null, remaining \u003C chunk ? pad.subarray(0, remaining) : pad);\r\n\t}\r\n\treturn str;\r\n}\r\n","TestCases":[{"Name":"append string","Code":"decodeAppend(arr)","IsDeferred":false},{"Name":"from char code","Code":"decodeFromCharCode(arr)","IsDeferred":false},{"Name":"chunk 100","Code":"decodeFromCharCode2(arr, 100)","IsDeferred":false},{"Name":"chunk 1000","Code":"decodeFromCharCode2(arr, 1000)","IsDeferred":false},{"Name":"chunk 10000","Code":"decodeFromCharCode2(arr, 10000)","IsDeferred":false},{"Name":"chunk 10","Code":"decodeFromCharCode2(arr, 10)","IsDeferred":false}]}