DEFAULT_BYTE_MODE_ECODING
DEFAULT_BYTE_MODE_ECODING = 'ISO-8859-1'
Default byte encoding.
Encoder.
ALPHANUMERIC_TABLE = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0x00-0x0f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0x10-0x1f 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, // 0x20-0x2f 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, // 0x30-0x3f -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, // 0x40-0x4f 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, ]
The original table is defined in the table 5 of JISX0510:2004 (p.19).
$codecs : array
Codec cache.
encode(string $content, \BaconQrCode\Common\ErrorCorrectionLevel $ecLevel, string $encoding = self::DEFAULT_BYTE_MODE_ECODING) : \BaconQrCode\Encoder\QrCode
Encodes "content" with the error correction level "ecLevel".
string | $content | |
\BaconQrCode\Common\ErrorCorrectionLevel | $ecLevel | |
string | $encoding |
chooseMaskPattern(\BaconQrCode\Common\BitArray $bits, \BaconQrCode\Common\ErrorCorrectionLevel $ecLevel, \BaconQrCode\Common\Version $version, \BaconQrCode\Encoder\ByteMatrix $matrix) : int
Chooses the best mask pattern for a matrix.
\BaconQrCode\Common\BitArray | $bits | |
\BaconQrCode\Common\ErrorCorrectionLevel | $ecLevel | |
\BaconQrCode\Common\Version | $version | |
\BaconQrCode\Encoder\ByteMatrix | $matrix |
chooseVersion(int $numInputBits, \BaconQrCode\Common\ErrorCorrectionLevel $ecLevel) : \BaconQrCode\Common\Version
Chooses the best version for the input.
int | $numInputBits | |
\BaconQrCode\Common\ErrorCorrectionLevel | $ecLevel |
if data is too big
terminateBits(int $numDataBytes, \BaconQrCode\Common\BitArray $bits) : void
Terminates the bits in a bit array.
int | $numDataBytes | |
\BaconQrCode\Common\BitArray | $bits |
if data bits cannot fit in the QR code
if bits size does not equal the capacity
getNumDataBytesAndNumEcBytesForBlockId(int $numTotalBytes, int $numDataBytes, int $numRsBlocks, int $blockId) : int[]
Gets number of data- and EC bytes for a block ID.
int | $numTotalBytes | |
int | $numDataBytes | |
int | $numRsBlocks | |
int | $blockId |
if block ID is too large
if EC bytes mismatch
if RS blocks mismatch
if total bytes mismatch
interleaveWithEcBytes(\BaconQrCode\Common\BitArray $bits, int $numTotalBytes, int $numDataBytes, int $numRsBlocks) : \BaconQrCode\Common\BitArray
Interleaves data with EC bytes.
\BaconQrCode\Common\BitArray | $bits | |
int | $numTotalBytes | |
int | $numDataBytes | |
int | $numRsBlocks |
if number of bits and data bytes does not match
if data bytes does not match offset
if an interleaving error occurs
appendLengthInfo(int $numLetters, \BaconQrCode\Common\Version $version, \BaconQrCode\Common\Mode $mode, \BaconQrCode\Common\BitArray $bits) : void
Appends length information to a bit array.
int | $numLetters | |
\BaconQrCode\Common\Version | $version | |
\BaconQrCode\Common\Mode | $mode | |
\BaconQrCode\Common\BitArray | $bits |
if num letters is bigger than expected
appendBytes(string $content, \BaconQrCode\Common\Mode $mode, \BaconQrCode\Common\BitArray $bits, string $encoding) : void
Appends bytes to a bit array in a specific mode.
string | $content | |
\BaconQrCode\Common\Mode | $mode | |
\BaconQrCode\Common\BitArray | $bits | |
string | $encoding |
if an invalid mode was supplied
appendAlphanumericBytes(string $content, \BaconQrCode\Common\BitArray $bits) : void
Appends alpha-numeric bytes to a bit array.
string | $content | |
\BaconQrCode\Common\BitArray | $bits |
if an invalid alphanumeric code was found
append8BitBytes(string $content, \BaconQrCode\Common\BitArray $bits, string $encoding) : void
Appends regular 8-bit bytes to a bit array.
string | $content | |
\BaconQrCode\Common\BitArray | $bits | |
string | $encoding |
if content cannot be encoded to target encoding
appendKanjiBytes(string $content, \BaconQrCode\Common\BitArray $bits) : void
Appends KANJI bytes to a bit array.
string | $content | |
\BaconQrCode\Common\BitArray | $bits |
if content does not seem to be encoded in SHIFT-JIS
if an invalid byte sequence occurs