Skip to content

Fix the prefix for three-byte ECI assignments - #239

Open
mikamikasuki wants to merge 1 commit into
fukuchi:masterfrom
mikamikasuki:fix/three-byte-eci-prefix
Open

mikamikasuki wants to merge 1 commit into
fukuchi:masterfrom
mikamikasuki:fix/three-byte-eci-prefix

Conversation

@mikamikasuki

Copy link
Copy Markdown

ECI assignments from 16384 through 999999 require a three-byte designator beginning with 110. The current constant places those prefix bits one hexadecimal digit too low. Change 0xc0000 to 0xc00000.

Add bitstream checks for assignments 0, 127, 128, 16383, 16384, and 999999, covering every length boundary and the maximum accepted value. The two three-byte cases fail before the fix.

Validation on macOS with Apple Clang 16:

  • All 12 CTest targets pass in Debug, shared Release with the command-line tool, and ASan/UBSan builds.
  • A strict C99 consumer compiles with -Wall -Wextra -Werror -pedantic-errors. Its complete QR symbols match the Nayuki encoder for 48 accepted ECI values with fixed version, error correction, mask, and payload.

Fixes #223.

Prepared with AI assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong constant in QRinput_encodeModeECI

1 participant