https://github.com/yyassif/barcode-reader
Read Barcode from Strings and Generate Barcode Images
https://github.com/yyassif/barcode-reader
barcode barcode-generator barcode-images barcode-reader
Last synced: about 1 month ago
JSON representation
Read Barcode from Strings and Generate Barcode Images
- Host: GitHub
- URL: https://github.com/yyassif/barcode-reader
- Owner: yyassif
- License: mit
- Created: 2021-07-16T16:34:38.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-17T22:40:38.000Z (almost 5 years ago)
- Last Synced: 2026-01-24T11:25:40.089Z (5 months ago)
- Topics: barcode, barcode-generator, barcode-images, barcode-reader
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Barcode-Reader
#### Read Barcode from Strings and Generate Barcode Images
We are Intrested in EAN-13: [EAN-13 (Wikipedia)](https://en.wikipedia.org/wiki/International_Article_Number#Binary_encoding_of_data_digits_into_EAN-13_barcode)
The input is a String of length 95 representing the barcode. Each databit (We are dealing with binary data) is displayed by a specified separator/character(mainly underscore or pipe characters) to represent the active bit and space to represent the dead bit. A separator is the bar area. The input may be reversed. You should decode the barcode so that the output was a String of length 13.
In case a barcode does not conform to the specifications, return (None -> Python) or (NULL -> C++).
The input final digit is the checksum. It is calculated from the other 12 digits, but in this mission it may be wrong. You must return (None -> Python) or (NULL -> C++) for this.
* Input: The separator character and the barcode String, (Note: The length of the barcode is fixed into 95 letters otherwise return None).
* Output: The decoded barcode number in a String format of length 13, None otherwise.
* Examples:
```python
barcode_reader('_', "_ _ _ __ _ ___ __ __ _ __ ____ _ ___ _ _ _ __ __ __ __ _ _ _ ___ _ ___ _ _ _ _") => "5901234123457"
barcode_reader('_', "_ _ __ _ _ ___ ____ _ _ __ _ ___ ___ _ _ _ __ __ _ ___ _ ___ _ ___ _ _ _ _ _ _") => "4003994155486"
```
* Finally:
For Python: We implement this into a GUI using pygame that receives the input and generates the corresponding image if Barcode is true otherwise we raise a message-box error.
For C++ I've never dealt with SFML so no clue how to implement it.