Skip to content

Write Code 11 check digit K as a dash when the value is 10 - #215

Merged
milon merged 1 commit into
milon:masterfrom
SashaMIT:codered-code11-k-digit
Oct 29, 2026
Merged

milon merged 1 commit into
milon:masterfrom
SashaMIT:codered-code11-k-digit

Conversation

@SashaMIT

Copy link
Copy Markdown
Contributor

Code 11 check digit C already turns a value of 10 into -. Check digit K appended the integer 10, which is the two characters 1 and 0, and the stop code was left off.

00000000007 has C = 7 and K = 10. The bars were S00000000007710. They should be S000000000077-S. A value of K from 0 through 9 is unchanged: 00000000001 is still S0000000000113S.

The new case failed on master (S000000000077-S versus S00000000007710) and passes once K uses the same dash as C.

Test plan

  • vendor/bin/phpunit --filter DNS1DTest (7 tests, 21 assertions)

Made with Cursor

The C digit already used a dash. K was appended as the two characters 10, and the stop code was left off.
@milon
milon merged commit aff97c2 into milon:master Oct 29, 2026
@milon

milon commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Merged manually onto master after resolving a test conflict with #214 (both PRs touched DNS1DTest).

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.

2 participants