Skip to content

Commit f47f07d

Browse files
committed
only output length
1 parent d87e9b0 commit f47f07d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/xetchunk-wasm/assembly/xet-chunker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const HASH_WINDOW_SIZE: i32 = 64;
99

1010
export class Chunk {
1111
hash: Uint8Array;
12-
data: Uint8Array;
12+
length: i32;
1313
}
1414

1515
// Type for the next() method return value
@@ -96,7 +96,7 @@ class XetChunker {
9696
if (createChunk || (isFinal && this.curChunkLen > 0)) {
9797
const chunkData = this.chunkBuf.subarray(0, this.curChunkLen);
9898
const chunk: Chunk = {
99-
data: chunkData,
99+
length: chunkData.length,
100100
hash: blake3(chunkData),
101101
};
102102
this.curChunkLen = 0;
@@ -114,6 +114,7 @@ class XetChunker {
114114
while (pos < data.length) {
115115
const result = this.next(data.subarray(pos), isFinal);
116116
if (result.chunk) {
117+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
117118
chunks.push(result.chunk!);
118119
}
119120
pos += result.bytesConsumed;

0 commit comments

Comments
 (0)