(filePath)
| 130 | } |
| 131 | |
| 132 | function chunkFile(filePath) { |
| 133 | const file = fs.readFileSync(filePath); |
| 134 | const fileStats = fs.statSync(filePath); |
| 135 | const fileSize = fileStats.size; |
| 136 | |
| 137 | let chunk = 1; |
| 138 | const chunks: number[][] = []; |
| 139 | for ( |
| 140 | let byteStart = 0; |
| 141 | byteStart < fileSize; |
| 142 | byteStart += MAX_CHUNK_SIZE, chunk++ |
| 143 | ) { |
| 144 | const videoSlice = file.buffer.slice( |
| 145 | byteStart, |
| 146 | Math.min(fileSize, byteStart + MAX_CHUNK_SIZE) |
| 147 | ); |
| 148 | const sliceToNat = encodeArrayBuffer(videoSlice); |
| 149 | chunks.push(sliceToNat); |
| 150 | } |
| 151 | |
| 152 | return chunks; |
| 153 | } |
| 154 | |
| 155 | function generateSeedData() { |
| 156 | const userNames = [ |
no test coverage detected