@lumera/sdk-js
    Preparing search index...

    Function createSingleBlockLayout

    • Creates a single-block RaptorQ layout from file bytes.

      This function generates a deterministic RaptorQ layout suitable for encoding the provided file data into a single source block. The layout is computed by the rq-wasm library and includes all parameters needed for encoding and decoding.

      Parameters

      • fileBytes: Uint8Array

        The complete file content as a Uint8Array

      Returns Promise<Uint8Array<ArrayBufferLike>>

      A promise that resolves to the raw layout file bytes (JSON format)

      If the WASM module fails to initialize or layout creation fails

      • The layout generation is deterministic: identical input always produces identical output
      • This is critical for LEP-1 compliance and data integrity verification
      • The layout bytes are what should be signed for LEP-1 compliance
      • Use parseLayoutFile() to parse the bytes into a Layout object if needed for verification
      const fileData = new TextEncoder().encode('Hello, Lumera!');
      const layoutBytes = await createSingleBlockLayout(fileData);

      // Parse if needed for verification
      const layout = parseLayoutFile(layoutBytes);
      console.log('Transfer length:', layout.transfer_length);
      console.log('Symbol size:', layout.symbol_size);