Skip to main content

Class: ChunkBuilder

Defined in: core-sdk/src/chunk/splitter.ts:16

A chunk (up to 4096 bytes of payload) being filled in by a ChunkSplitter, before it's sealed. Unlike the immutable CAC Chunk, this is a mutable buffer - only hash()/encryptedHash()/build() finalize it.

Constructors

Constructor

new ChunkBuilder(span?): ChunkBuilder

Defined in: core-sdk/src/chunk/splitter.ts:20

Parameters

span?

bigint

Returns

ChunkBuilder

Properties

span

span: bigint

Defined in: core-sdk/src/chunk/splitter.ts:17


writer

writer: Uint8ArrayWriter

Defined in: core-sdk/src/chunk/splitter.ts:18

Methods

build()

build(): Uint8Array

Defined in: core-sdk/src/chunk/splitter.ts:28

Returns the raw chunk bytes: 8-byte span || 4096-byte payload buffer.

Returns

Uint8Array


encryptedHash()

encryptedHash(key?): object

Defined in: core-sdk/src/chunk/splitter.ts:43

Encrypts this chunk with key (generating a random one if omitted) and returns the resulting address alongside the key used.

Parameters

key?

Uint8Array<ArrayBufferLike>

Returns

object

address

address: Reference

key

key: Uint8Array


hash()

hash(): Reference

Defined in: core-sdk/src/chunk/splitter.ts:35

Computes the unencrypted BMT address of this chunk.

Returns

Reference

💬 Get Help