WalrusFfiBindings class
Dart FFI bindings for the walrus_ffi native library.
Provides canonical Walrus RS2 blob encoding and metadata computation that is bit-identical to walrus-core / walrus-wasm.
Library Discovery
The native library is searched in this order:
- Path set via configure (call before first use)
WALRUS_FFI_LIBenvironment variable- Relative to the
dartuspackage source directory (auto-resolved) - Relative to the current working directory
- System library paths (
/usr/local/lib/)
For Flutter apps, call configure early (e.g. in main()) with the
correct path to libwalrus_ffi.dylib.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
computeMetadata(
int nShards, Uint8List data) → WalrusBlobMetadata - Compute blob metadata (blob ID, root hash) without returning slivers.
-
decodeBlob(
{required int nShards, required int blobSize, required List< ({Uint8List data, int index})> slivers}) → Uint8List - Decode (reconstruct) a blob from primary slivers via Rust FFI.
-
encodeBlob(
int nShards, Uint8List data) → WalrusFfiEncodedBlob - Full encode: compute metadata AND all primary + secondary slivers.
-
encodingParams(
int nShards, int blobLen) → WalrusEncodingParams - Get encoding parameters for a given shard count and blob size.
-
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 Properties
- isAvailable → bool
-
Whether the native library has been loaded successfully.
no setter
- resolvedPath → String?
-
The file path of the loaded native library, or
nullif not loaded.no setter