WalrusBlobEncoder class

Concrete BlobEncoder using Rust FFI for canonical RS2 encoding.

Usage:

final encoder = WalrusBlobEncoder();

// Full encode (for direct mode)
final encoded = encoder.encodeBlob(rawData, numShards);

// Metadata only (for upload relay)
final metadata = await encoder.computeMetadata(rawData, numShards);
Inheritance

Constructors

WalrusBlobEncoder({int encodingType = kEncodingTypeRS2})

Properties

encodingType int
Encoding type used for all blobs.
final
hashCode int
The hash code for this object.
no setterinherited
isNativeAvailable bool
Whether the native FFI encoder is available on this platform.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

computeMetadata(Uint8List data, int numShards) Future<BlobMetadata>
Compute metadata for the given blob data without full encoding.
override
computeMetadataSync(Uint8List data, int numShards) BlobMetadata
Synchronous version of computeMetadata suitable for use in Isolate.run() to avoid blocking the main thread.
decodeBlob({required List<SliverData> primarySlivers, required int numShards, required int unencodedLength}) Uint8List
Decode (reconstruct) a blob from collected primary slivers.
encodeBlob(Uint8List data, int numShards) EncodedBlob
Encode a blob into primary and secondary slivers for all shards.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

bcsSliverData(SliverData sliver) Uint8List
BCS-encode a SliverData for storage node PUT requests.