-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For fixed-width inputs, do not automatically calculate a missing check digit, unless actually told to #263
Comments
Soliciting opinions on the above from those who have to handle fallout from downstream or cross-testing: |
This looks good to me and makes sense. Curious to see if @metafloor changes the API to match, or if defaults will be maintained along with a new negated boolean (skip-calculatecheck) to access this new behavior. Thanks for checking with us! |
Hi, option (2) looks good to me.
Zint should probably do the same, it's permissive at the moment like
current BWIPP.
…On Fri, Feb 16, 2024 at 3:01 PM Caylan ***@***.***> wrote:
This looks good to me and makes sense. Curious to see if @metafloor
<https://github.com/metafloor> changes the API to match, or if defaults
will be maintained along with a new negated boolean (skip-calculatecheck)
to access this new behavior. Thanks for checking with us!
—
Reply to this email directly, view it on GitHub
<#263 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADVVPVESTT44GYDWVK5XFTYT5YERAVCNFSM6AAAAABDMA4QYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBYGU2DEMZUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@semireg For API back compatibility, we could introduce a deprecated BWIPP option |
I am traveling this weekend, but would like to add logging to the bwip-js public API to get a sense of how much current usage relies on automatic checkdigit calculation. This is a potentially breaking change for folks who rely on the public API for commercial use. |
I added logging that just records text length for the list of symbols above. The service provider (heroku) restarts the service every 24 hours, and the numbers below represent about 14 hours uptime. Aside from lots of spurious text lengths that would have generated errors, here is sample usage for the public api:
The pairs of digits are My thinking is that when this change hits, bwip-js will add additional logic to the ean, upc and itf14 symbols to automatically add the |
Nice work on the stats. By |
@semireg: I have not decided public api vs base bwip-js, but am leaning towards just the public api. My thinking is that when this change hits, bwip-js will release as a major version change, since it is a breaking api change. That will keep most npm users tied to the previous version until they explicitly choose to make the upgrade. The public api users, on the other hand, likely have minimal visibility into these types of changes |
My current plan is as follows:
So BWIP-JS et al. can just unconditionally inject Does that work? This way the transition is to simply remove |
@terryburton: For bwip-js, the logic around injecting |
Agreed. |
We've focused a lot on reducing human error in recent releases, e.g. with the GS1 AI syntax linting.
One source of error that I'm aware of is users accidentally missing a digit in the input for a symbology that has fixed-width input (such as EAN-13) and not realising that a check digit has been automatically added.
Given the example of EAN-13, the current behaviour is:
9520123456788
952012345678
In future, a new
calculatecheck
option will be introduced, and the behaviour will be changed to:9520123456788
952012345678
Error: EAN-13 must be 13 digits, or 12 with calculatecheck option
952012345678
calculatecheck
There's a decision to be made over whether or not to silently ignore the new
calculatecheck
option when a full width input is already provided, option (1):9520123456788
calculatecheck
versus option (2):
9520123456788
calculatecheck
Error: EAN-13 must be 12 digits with calculatecheck option
My preference is option (2) since this covers the case that a user wants their check digit to be calculated but erroneously enters 13 digits (and the check calculation happens to pass).
The above is an "API change" that maximises the utility of the check digit that is built into these fixed-width symbologies (and their derivatives):
The text was updated successfully, but these errors were encountered: