lindell / lindell/JsBarcode

Get full ean13 barcode with check digit if only 12 digits used

Open
#362 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Users can input 12 or 13 digits to generate an EAN13 barcode.

If they only use 12, how do I get the full code that includes the last check digit?

Seems like the `valid` callback would be a good place, but it seems to only return `true` or `false`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how EAN13 handles 12-digit input and how the `valid` callback is invoked. Confirm the desired public API for retrieving the generated check digit, then verify that the returned full barcode is correct for both 12- and 13-digit inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.