{"ScriptPreparationCode":"function get1024Bytes(n) {\r\n const bytes = new Uint8Array(n * 1024);\r\n for (let i = 0; i \u003C bytes.length; i \u002B= 1) {\r\n bytes[i] = Math.random() * 0xff;\r\n }\r\n return bytes;\r\n}\r\n\r\nconst bytes = get1024Bytes(128);\r\n\r\nconst utf16decoder = new TextDecoder(\u0027utf-16\u0027);\r\n\r\n// An example result:\r\n// const binString = Array.from(bytes, (byte) =\u003E String.fromCodePoint(byte)).join(\u0022\u0022);","TestCases":[{"Name":"Array.from \u002B join \u002B fromCodePoint","Code":"return Array.from(bytes, (byte) =\u003E\r\n String.fromCodePoint(byte),\r\n).join(\u0022\u0022);","IsDeferred":false},{"Name":"Array.from \u002B join \u002B fromCharCode","Code":"return Array.from(bytes, (byte) =\u003E\r\n String.fromCharCode(byte),\r\n).join(\u0022\u0022);","IsDeferred":false},{"Name":"Array.reduce \u002B fromCodePoint","Code":"return bytes.reduce((s, byte) =\u003E s \u002B String.fromCodePoint(byte), \u0022\u0022);","IsDeferred":false},{"Name":"Array.reduce \u002B fromCharCode","Code":"return bytes.reduce((s, byte) =\u003E s \u002B String.fromCharCode(byte), \u0022\u0022);","IsDeferred":false},{"Name":"String concatenation \u002B fromCodePoint","Code":"let s = \u0027\u0027;\r\nfor (const byte of bytes) {\r\n s \u002B= String.fromCodePoint(byte);\r\n}\r\nreturn s;","IsDeferred":false},{"Name":"String concatenation \u002B fromCharCode","Code":"let s = \u0027\u0027;\r\nfor (const byte of bytes) {\r\n s \u002B= String.fromCharCode(byte);\r\n}\r\nreturn s;","IsDeferred":false},{"Name":"Function.apply \u002B Array.reduce\u002B fromCodePoint (chunked)","Code":" const QUANTUM = 32768;\r\n const chunks = [];\r\n for (let i = 0; i \u003C bytes.length; i \u002B= QUANTUM) {\r\n chunks.push(bytes.slice(i, i \u002B QUANTUM));\r\n }\r\n return chunks.reduce((s, i) =\u003E s \u002B String.fromCodePoint.apply(null, i), \u0027\u0027);","IsDeferred":false},{"Name":"Function.apply \u002B Array.reduce \u002B fromCharCode (chunked)","Code":" const QUANTUM = 32768;\r\n const chunks = [];\r\n for (let i = 0; i \u003C bytes.length; i \u002B= QUANTUM) {\r\n chunks.push(bytes.slice(i, i \u002B QUANTUM));\r\n }\r\n return chunks.reduce((s, i) =\u003E s \u002B String.fromCharCode.apply(null, i), \u0027\u0027);","IsDeferred":false},{"Name":"Function.apply \u002B String concatenation \u002B fromCodePoint (chunked)","Code":" const QUANTUM = 32768;\r\n let s = \u0027\u0027;\r\n for (let i = 0; i \u003C bytes.length; i \u002B= QUANTUM) {\r\n s \u002B= String.fromCodePoint.apply(null, bytes.slice(i, i \u002B QUANTUM));\r\n }\r\n return s;","IsDeferred":false},{"Name":"Function.apply \u002B String concatenation \u002B fromCharCode (chunked)","Code":" const QUANTUM = 32768;\r\n let s = \u0027\u0027;\r\n for (let i = 0; i \u003C bytes.length; i \u002B= QUANTUM) {\r\n s \u002B= String.fromCharCode.apply(null, bytes.slice(i, i \u002B QUANTUM));\r\n }\r\n return s;","IsDeferred":false},{"Name":"Function.apply \u002B Array.reduce\u002B fromCodePoint (small chunks)","Code":" const QUANTUM = 128;\r\n const chunks = [];\r\n for (let i = 0; i \u003C bytes.length; i \u002B= QUANTUM) {\r\n chunks.push(bytes.slice(i, i \u002B QUANTUM));\r\n }\r\n return chunks.reduce((s, i) =\u003E s \u002B String.fromCodePoint.apply(null, i), \u0027\u0027);","IsDeferred":false},{"Name":"Function.apply \u002B Array.reduce \u002B fromCharCode (small chunks)","Code":" const QUANTUM = 128;\r\n const chunks = [];\r\n for (let i = 0; i \u003C bytes.length; i \u002B= QUANTUM) {\r\n chunks.push(bytes.slice(i, i \u002B QUANTUM));\r\n }\r\n return chunks.reduce((s, i) =\u003E s \u002B String.fromCharCode.apply(null, i), \u0027\u0027);","IsDeferred":false},{"Name":"Function.apply \u002B String concatenation \u002B fromCodePoint (small chunks)","Code":" const QUANTUM = 128;\r\n let s = \u0027\u0027;\r\n for (let i = 0; i \u003C bytes.length; i \u002B= QUANTUM) {\r\n s \u002B= String.fromCodePoint.apply(null, bytes.slice(i, i \u002B QUANTUM));\r\n }\r\n return s;","IsDeferred":false},{"Name":"Function.apply \u002B String concatenation \u002B fromCharCode (small chunks)","Code":" const QUANTUM = 128;\r\n let s = \u0027\u0027;\r\n for (let i = 0; i \u003C bytes.length; i \u002B= QUANTUM) {\r\n s \u002B= String.fromCharCode.apply(null, bytes.slice(i, i \u002B QUANTUM));\r\n }\r\n return s;","IsDeferred":false},{"Name":"utf-16 TextDecoder","Code":"return utf16decoder.decode(new Uint16Array(bytes));","IsDeferred":false}]}