Open petaflot opened 1 year ago
Base: 80.63% // Head: 79.36% // Decreases project coverage by -1.26%
:warning:
Coverage data is based on head (
ba6ce09
) compared to base (f3a7046
). Patch coverage: 39.28% of modified lines in pull request are covered.:exclamation: Current head ba6ce09 differs from pull request most recent head 943acae. Consider uploading reports for the commit 943acae to get more accurate results
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
it's not standard at all (hence the new defaults). it's a workaround because no 1D barcode that I know of can encode arbitrary bytes (at most a variant of extended ASCII)
the MSI barcode will encode just an int (hence the new default values for "byteorder" and "encoding" : the user must force this workaround, otherwise an exception will be raised at init. I specifically chose to use MSI for this purpose, because since it normally allows only integer encoding the risk of confusion is minimal (user has to explicitly force the conversion : the same approach with ie. Code128 would get very confusing)
does this seem like a reasonable approach? it's a quite inefficient method of encoding data (mostly because of BCD being inefficient in itself) but if the purpose is just to encode short strings it's acceptable. the code could be extended to split longer strings on multiple lines (sort-of like DataBar does) that could be read sequentially.
also, from https://www.dynamsoft.com/blog/insights/the-comprehensive-guide-to-1d-and-2d-barcodes/ :
MSI Codes are used in inventory management to mark shelves and containers to identify storage locations.
Industry
Inventory
Warehousing
This basically means that MSI codes are used "internally" by organizations, so it is unlikely that any "consumer" will stumble on such a code (those codes are used in a specific context) ; this is - again - less chance for confusion
printing the decoded string under the barcode lessens even more the risk of confusion
FIY, for displaying bytestrings that cannot be decoded (I have a great deal of those), I wrote https://github.com/petaflot/bytes_as_braille ; I am likely to add a "label" argument to MSI.init() to let the user specify the label - I didn't want to make bytes_as_braille
a dependency of python-barcode
The JsBarcode project includes multiple implementations of MSI:
The JsBarcode project includes multiple implementations of MSI:
* MSI * MSI10 * MSI1010 * MSI11 * MSI1110
isn't that javascript?
The JsBarcode project includes multiple implementations of MSI:
* MSI * MSI10 * MSI1010 * MSI11 * MSI1110
isn't that javascript?
It is, but porting the code over to Python would be an easy task. I was just citing it as an implementation of MSI.
also allows encoding of strings and bytestrings (allows encoding any symbol) by converting them to int ; in this case, string representation is shown in human-readable string