Expand description
WebAssembly bindings for the Tensogram N-tensor message format.
Provides encode, decode, scan, streaming decode, range decode, hash,
validation, pre-encoded encode, simple_packing params, and a
frame-at-a-time StreamingEncoder — accessible from JavaScript /
TypeScript via wasm-bindgen.
Tensor payloads are returned as zero-copy TypedArray views into WASM linear memory for 60fps visualisation performance.
§Compressor support
This WASM build supports lz4, szip (pure-Rust), and zstd (pure-Rust). Attempts to decode blosc2/zfp/sz3 compressed data will return an error.
Structs§
- Decoded
Message - Handle to a decoded Tensogram message.
- Streaming
Decoder - Frame-by-frame streaming decoder.
- Streaming
Encoder - Streaming encoder with a selectable sink: in-memory buffer (default) or caller-supplied JS callback.
Functions§
- compute_
hash - Compute the hex-encoded hash of a byte slice.
- decode
- Decode all objects from a complete Tensogram message.
- decode_
metadata - Decode only the global metadata from a message (no payload decoding).
- decode_
object - Decode a single object by index.
- decode_
object_ from_ frame - Decode a single data-object frame’s full bytes to a
DecodedMessagethat owns one decoded object. - decode_
range - Decode partial sub-tensor ranges from a single data object.
- decode_
range_ from_ frame - Extract ranges from a single data-object frame.
- doctor
- Collect environment diagnostics: build metadata, compiled-in feature states, and core encode/decode self-test results.
- encode
- Encode objects into a Tensogram message.
- encode_
pre_ encoded - Encode a complete Tensogram message from pre-encoded data objects.
- parse_
backward_ postamble_ outcome - Parse a backward-postamble fetch and return its outcome.
- parse_
descriptor_ cbor - Decode a
DataObjectDescriptorfrom its raw CBOR bytes. - parse_
footer_ chunk - Parse footer metadata + index from a chunk that covers the footer
region — i.e.
[first_footer_offset, message_end - POSTAMBLE_SIZE). - parse_
forward_ preamble_ outcome - Parse a forward-preamble fetch and return its outcome.
- parse_
header_ chunk - Parse header metadata + index from a chunk that starts at message offset 0 (the preamble). Stops at the first data-object or preceder frame. Returns nulls for frames that fall outside the supplied chunk so TS can decide to widen its Range fetch.
- read_
data_ object_ frame_ footer - Parse the 20-byte footer of a data-object frame (type
NTensorFrame). - read_
data_ object_ frame_ header - Parse the 16-byte header of a data-object frame.
- read_
postamble_ info - Inspect a wire-format postamble.
- read_
preamble_ info - Inspect a wire-format preamble.
- same_
message_ check trueiff a forwardHitand a backward-validated layout describe the same message — used by the dispatch table to detect the 1-message file and odd-count meet-in-the-middle cases.- scan
- Scan a buffer for concatenated Tensogram messages.
- simple_
packing_ compute_ params - Compute the simple-packing parameters (reference value, binary/decimal scale factors, bits-per-value) for a float64 array.
- validate_
backward_ preamble_ outcome - Validate a backward candidate preamble and return the commit decision.
- validate_
buffer - Validate a single Tensogram message buffer. Returns a JSON string
matching the structure emitted by
tensogram::validate::ValidationReport:{ issues: [...], object_count: N, hash_verified: bool }.