mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-29 02:49:21 +00:00
format
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
import chunk from '../chunk.js';
|
||||
|
||||
export default (trackerChunks: Uint8Array[]) => {
|
||||
let trackerChunksTotalLength = 0;
|
||||
let trackerChunksTotalLength = 0;
|
||||
|
||||
trackerChunks.forEach((trackerChunk) => {
|
||||
trackerChunksTotalLength += trackerChunk.length;
|
||||
});
|
||||
trackerChunks.forEach((trackerChunk) => {
|
||||
trackerChunksTotalLength += trackerChunk.length;
|
||||
});
|
||||
|
||||
const trackerChunksBytes = new Uint8Array(trackerChunksTotalLength);
|
||||
const trackerChunksBytes = new Uint8Array(trackerChunksTotalLength);
|
||||
|
||||
let offset = 0;
|
||||
let offset = 0;
|
||||
|
||||
trackerChunks.forEach((trackerChunk) => {
|
||||
trackerChunksBytes.set(trackerChunk, offset);
|
||||
offset += trackerChunk.length;
|
||||
});
|
||||
trackerChunks.forEach((trackerChunk) => {
|
||||
trackerChunksBytes.set(trackerChunk, offset);
|
||||
offset += trackerChunk.length;
|
||||
});
|
||||
|
||||
return chunk(0x0001, trackerChunksBytes, true);
|
||||
return chunk(0x0001, trackerChunksBytes, true);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user