{"ScriptPreparationCode":"function numberToUint8Array64LE_DataView(num) {\r\n const buf = new ArrayBuffer(8)\r\n const view = new DataView(buf)\r\n view.setUint32(0, num, true)\r\n view.setUint32(4, num \u003E\u003E\u003E 32, true)\r\n return new Uint8Array(buf)\r\n}\r\n\r\nfunction numberToUint8Array64LE_direct(num) {\r\n const result = new Uint8Array(8)\r\n result[0] = num \u0026 0xff\r\n result[1] = (num \u003E\u003E\u003E 8) \u0026 0xff\r\n result[2] = (num \u003E\u003E\u003E 16) \u0026 0xff\r\n result[3] = (num \u003E\u003E\u003E 24) \u0026 0xff\r\n result[4] = (num \u003E\u003E\u003E 32) \u0026 0xff\r\n result[5] = (num \u003E\u003E\u003E 40) \u0026 0xff\r\n result[6] = (num \u003E\u003E\u003E 48) \u0026 0xff\r\n result[7] = (num \u003E\u003E\u003E 56) \u0026 0xff\r\n return result\r\n}\r\n\r\nfunction numberToUint8Array64LE_bigint(num) {\r\n const bigIntValue = BigInt.asUintN(64, BigInt(num));\r\n const buffer = new ArrayBuffer(8);\r\n const dataView = new DataView(buffer);\r\n dataView.setBigUint64(0, bigIntValue, true);\r\n return Uint8Array.from(buffer.slice(0, 8));\r\n}\r\n\r\nfunction numberToUint8Array64LE_withLoop(num) {\r\n const result = new Uint8Array(8)\r\n for (let i = 0; i \u003C 8; i\u002B\u002B) {\r\n result[i] = num \u0026 0xff\r\n num = num \u003E\u003E\u003E 8\r\n }\r\n return result\r\n}\r\n\r\nfunction numberToUint8Array64LE_withLoop_noAssignment(num) {\r\n const result = new Uint8Array(8)\r\n result[0] = num \u0026 0xff\r\n for (let i = 1, j = 8; i \u003C 8; i\u002B\u002B, j \u002B= 8) {\r\n result[i] = (num \u003E\u003E\u003E j) \u0026 0xff\r\n }\r\n return result\r\n}\r\n\r\nfunction numberToUint8Array64LE_withLoop_noAssignment_noSecondCounter(num) {\r\n const result = new Uint8Array(8)\r\n result[0] = num \u0026 0xff\r\n for (let i = 1; i \u003C 8; i\u002B\u002B) {\r\n result[i] = (num \u003E\u003E\u003E (i \u003C\u003C 3)) \u0026 0xff\r\n }\r\n return result\r\n}\r\n\r\nfunction numberToUint8Array64LE_withLoop_bugoutOn0(num) {\r\n const result = new Uint8Array(8)\r\n for (let i = 0; num != 0; i\u002B\u002B, num = num \u003E\u003E\u003E 8) {\r\n result[i] = num \u0026 0xff\r\n }\r\n return result\r\n}","TestCases":[{"Name":"Through DataView","Code":"numberToUint8Array64LE_DataView(0xababababab)","IsDeferred":false},{"Name":"Direct","Code":"numberToUint8Array64LE_direct(0xababababab)","IsDeferred":false},{"Name":"With BigInt","Code":"numberToUint8Array64LE_bigint(0xababababab)","IsDeferred":false},{"Name":"Simple Loop","Code":"numberToUint8Array64LE_withLoop(0xababababab)","IsDeferred":false},{"Name":"Loop No Assignment","Code":"numberToUint8Array64LE_withLoop_noAssignment(0xababababab)","IsDeferred":false},{"Name":"Loop No Assignment No Second Counter","Code":"numberToUint8Array64LE_withLoop_noAssignment_noSecondCounter(0xababababab)","IsDeferred":false},{"Name":"Loop Exit on 0","Code":"numberToUint8Array64LE_withLoop_bugoutOn0(0xababababab)","IsDeferred":false},{"Name":"Loop Exit on 0 single byte","Code":"numberToUint8Array64LE_withLoop_bugoutOn0(0xab)","IsDeferred":false},{"Name":"Loop Exit on 0 with 0","Code":"numberToUint8Array64LE_withLoop_bugoutOn0(0)","IsDeferred":false}]}