{"ScriptPreparationCode":"\r\nfunction generateRandomUint8Array(length) {\r\n const array = new Uint8Array(length);\r\n window.crypto.getRandomValues(array);\r\n return array;\r\n}\r\n\r\nfunction readInt64LE(bytes, offset) {\r\n return (bytes[offset] | (bytes[offset \u002B 1] \u003C\u003C 8) | (bytes[offset \u002B 2] \u003C\u003C 16) | (bytes[offset \u002B 3] \u003C\u003C 24) | (bytes[offset \u002B 4] \u003C\u003C 32) | (bytes[offset \u002B 5] \u003C\u003C 40)) \u003E\u003E\u003E 0;\r\n}\r\n","TestCases":[{"Name":"interleave","Code":"// Example usage:\r\nconst bytes = generateRandomUint8Array(120);\r\nlet sp = []\r\n\r\n\r\nfor (let i = 0; i \u003C 8; \u002B\u002Bi) {\r\n let id = readInt64LE(bytes, (i * 10) \u002B 8); // imageset id [8]\r\n let imgIdx0 = bytes[(i * 10) \u002B 16]; // image index 0 [9]\r\n let imgIdx1 = bytes[(i * 10) \u002B 17]; // image index 1 [10]\r\n\r\n sp.push([id, imgIdx0, imgIdx1])\r\n}","IsDeferred":false},{"Name":"separate","Code":"// Example usage:\r\nconst bytes = generateRandomUint8Array(120);\r\nlet sp = []\r\n\r\n\r\nfor (let i = 0; i \u003C 8; \u002B\u002Bi) {\r\n let id = readInt64LE(bytes, (i \u003C\u003C 3) \u002B 8); // imageset id [8]\r\n sp.push(id)\r\n}\r\n\r\nfor (let i = 0; i \u003C 8; \u002B\u002Bi) {\r\n let imgIdx0 = bytes[i\u002B72];\r\n sp.push(imgIdx0)\r\n}\r\n\r\nfor (let i = 0; i \u003C 8; \u002B\u002Bi) {\r\n let imgIdx1 = bytes[i\u002B80];\r\n sp.push(imgIdx1)\r\n}","IsDeferred":false}]}