-
-
Notifications
You must be signed in to change notification settings - Fork 479
docs: Create scanning-barcodes.md #12179
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
Conversation
Barcode scanners can return codes in various formats (EAN-8, EAN-13, UPC-A, UPC-E). To ensure a match in the database, you **must normalize the barcode to the EAN-13 format.** | ||
|
||
1. **Pad with Zeros:** If the scanned barcode has fewer than 13 digits, pad it with leading zeros until it reaches 13 digits. For example, `12345678` (EAN-8) becomes `0000012345678`. | ||
2. **Calculate the Check Digit (for 12-digit UPC-A):** If you have a 12-digit barcode (common in North America), you must calculate the 13th digit (the EAN-13 check digit) and append it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is false, 12 digit barcodes are not barcodes missing a check digit.
Once you have a barcode string, you must normalize it before querying the correct database. | ||
|
||
#### **✔️ Step 3.1: Pre-process the Barcode (Normalization)** | ||
Barcode scanners can return codes in various formats (EAN-8, EAN-13, UPC-A, UPC-E). To ensure a match in the database, you **must normalize the barcode to the EAN-13 format.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this, clients should not try to normalize barcodes.
|
What
docs: Create scanning-barcodes.MD
Create a tutorial to create great barcode scanning experiences