Options
All
  • Public
  • Public/Protected
  • All
Menu

Encapsulates a block of data within a QR Code. QR Codes may split their data into multiple blocks, each of which is a unit of data and error-correction codewords. Each is represented by an instance of this class.

author

Sean Owen

Hierarchy

  • DataBlock

Index

Constructors

Private constructor

  • new DataBlock(numDataCodewords: number, codewords: Uint8Array): DataBlock

Properties

Private codewords

codewords: Uint8Array

Private numDataCodewords

numDataCodewords: number

Methods

getCodewords

  • getCodewords(): Uint8Array

getNumDataCodewords

  • getNumDataCodewords(): number

Static getDataBlocks

  • When QR Codes use multiple data blocks, they are actually interleaved. That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This method will separate the data into original blocks.

    Parameters

    • rawCodewords: Uint8Array

      bytes as read directly from the QR Code

    • version: Version

      version of the QR Code

    • ecLevel: ErrorCorrectionLevel

      error-correction level of the QR Code

    Returns DataBlock[]

    DataBlocks containing original bytes, "de-interleaved" from representation in the QR Code

Generated using TypeDoc