I'm reading barcodes in an iOS app using the built-in barcode recognizer.
I scanned the barcode on a bottle of prescription medication. I'm expecting this barcode to resolve to a number that I can use to refer to a medication database. What iOS tells me is this:
type: org.iso.Code128
string value: xAAAJ5wEA
I checked the Wikipedia entry for "Code 128" but I'm still not sure how to decode the string further. I'm assuming it's a "Code Set C" value, but I don't see how to translate it into the series of decimal numbers I'm expecting.
Any help would be appreciated, thanks.
Code 128 is a compact one-dimensional barcode primarily used for alphanumeric barcodes. All 128 characters in ASCII are encoded.
In this case, your result is almost certainly a barcode encoding "xAAAJ5wEA". That barcode looks like this Code 128 barcode:
Prescription medication tend to encode a great deal of information. Possibly the customer record number, how many refills, what medication, etc. It can be used to pull up all information about the customer in the pharmacy computers. Precisely how this data is encoded will likely be based on the pharmacy policies. Therefore you will need to customize your software for each pharmacy.
Related
What encoding/encryption/manipulation would turn the following values from what you see on the left to what's on the right?
146.00 => 4046401A36E2EB1D
36.30 => 4042266666666666
76.22 => 40530E147AE147AE
3865.20 => 40DA06683E8C7FD4
0.200 => 3FC999999999999A
I am working with an XML file from a software application we use at work. I am trying to set up a tool that helps interpret and manipulate the XML files outside of the software, to allow work to be done while off of the limited licenses we have. In the software, users populate fields and can import/export XML files containing the info they have entered. When I open these XML files in a text editor, all the fields are clearly labeled as they would be in the program itself. The user input data is "encoded" however (hoping that's the accurate term), and it appears to be hexadecimal.
I have been able to take string and integer inputs and convert them back and forth to what's in the XML file, although the strings are backwards (the hex decodes to "w im 9" when the user input "9 mi w"). However anything the user enters as a decimal number is giving me trouble [edit: I determined the trouble is with fields that have associated units]. Some preliminary research has brought me to the idea of "attributes", but I don't know enough of XML to make use/sense of it. Below are two lines from the XML, the first one where the user data plays nice when trying to decode, and the second where something else is happening:
<BRIDGE_ID HEX="true">#31</BRIDGE_ID> Here the user just entered "1" for the Bridge ID
<LENGTH Units="23" HEX="true">#3FD381D7DBF487FD</LENGTH> Here the user entered "1" for length and the program forced it to 1.00 before exporting. This field is in feet.
I have discovered that the fields which assign units to the values are the ones that are not reversing nicely. Any field without units, i.e. no attributes in XML, works great in a simple web decoder. So the attributes complicate it somehow. In the first 5 examples at the top, the first value is in feet (Units="23"), while the second and third fields are both degrees (Units="52").
I know this is all over the place! Thank you anyone who can make sense of it and help me out!
For the 2nd, 3rd, and 5th values, the 16-digit hex string is simply the hex representation of the internal 64-bit double-precision IEEE floating point value whose decimal representation appears on the left.
That doesn't work for the 1st and 4th values, where the hex string is the representation of 44.50 and 26649.628817677338 respectively. Since you talk about units, perhaps there might be conversion from American units to metric involved?
This question has nothing to do with XML. Just because the data is wrapped in XML tags doesn't make it an XML question.
I have created one bar code scanner application and used AVFoundation native framework. Some of our barcode contains hidden unicode characters and we are unable to scan it. Here is an example of bar code:
]d201000000000010!0000-023
I am getting above code like: \u{1D}01000000000010\u{1D}0000-023
In above barcode ]d2 varies. I am unable to find type of the barcode. How can I parse that Unicode contained string into normal string? Does any one face this type of issue or barcode? Thanks in advance.
\u{1D}01000000000010\u{1D}0000-023 Looks to be a GS1-formatted barcode. Full spec is here And the values after the {1D} delimiter are call "application identifiers" and identify the type of data contained in that field. GS1 is really common in any industry where full supply-chain tracking is needed such as the medical device industry, etc. A concise list of application identifiers is here
The bar code 128 subset C the number of digits should always be even.
How to print bar code with odd character? example:
1517072011170323703007607271023031701
Using DelhiXE7 and Fortes Report 4.0 VCL
Is this question related to finnish banking barcode ?
if YES: You must pad the data to be of even length, according to the documentation published by the bank. Switching the barcode encoding system is not allowed by the relevant banking standard.
reference URL: http://www.finanssiala.fi/maksujenvalitys/dokumentit/Bank_bar_code_guide.pdf
if NO: Just first encode the even-length part, then switch to code 128A or 128B using the encoding switching special "character" and finally encode the last digit using either 128A or 128B, whichever serves you better.
According to the algorithm for ISBN10, the check digit can be X, it means, it may not be a number.
But the output of google API: https://www.googleapis.com/books/v1/volumes?q=isbn:xxx uses an integer type for ISBN10 and ISBN13. Why?
P.S.:
The following is part of the google API output:
industryIdentifiers = (
{
identifier = 7542637975;
type = "ISBN_10";
},
{
identifier = 9787542637970;
type = "ISBN_13";
}
);
ISBN-10 in theory should have been replaced by ISBN-13 by 2007. Obviously, this is not possible for already-sold publications, and some publishers still maintain ISBN-10 rather than changing to ISBN-13 (in the same way as some manufacturers maintain UPC-A instead of EAN-13 or GSi.)
To convert a USBN-10 to USBN-13, simply take the first 9 digits of the USBN, prefix it with 978 and then calculate the check digit using the standard EAN algorithm. Use the 13-digit result as your key to locate the item (as a 64-bit unsigned integer).
You can always extract the ISBN-10 by removing the first 3 digits and the check-digit and using the ISBN-10 algorithm to re-calculate the check character.
This way, you only need to record the 13-digit version. If you have an ISBN-10 (read by scanner) or you need to produce an ISBN-10 (for whatever purpose) it's simply a matter of applying the appropriate conversion algorithm.
Depending on your application, you may wish to consider what to do with ISMN (for music) or ISSN (periodical) numbers. Periodicals are the more problematic. The barcode extension usually yields month or week of publication, but the -13 version remains the same. That's fine for a seller or such items, as whatever-01 would be January, and these would be well out-of-date (and hence no-longer-in-stock) by the following January when the same number would be used. Not so good for an archival function like a library, though...
Thank you all for the helpful answers. I finally find out the original response from google is in string format. It's printed like an integer just because of my json printer.
We need to parse the GS1 datamatrix barcode which will be provided by other party. We know they are going to use GTIN(01), lot number(10), Expiration date(17), serial number (21). The problems is that barcode reader output a string, the format is like this 01076123456789001710050310AC3453G321455777. Since there is not separator and both serial number and lot number are variable length according to GS1 standard, we have trouble to identify segments. My understanding is that it seems like the best way to parse is to embed the parser in the scanning device, not from the application. But we didn't plan an embed software yet. How can I implement the parser? Any suggestions?
There should be a FNC1 character at the end of a variable-length field that is not filled to maximum; so that FNC1 will appear between the G3 and the 21.
FNC1 is invisible to humans but can be detected by scanners and will be reproduced in the string reported by the scanner. Simply send the string directly to a text file and examine the text with a hex reader. the FNC1 should be obvious.
If you can, it might be an idea to swap the sequence of the 21 field and the 10 field since you appear to be using a pure-numeric for 21. This would make the barcode produced a little shorter.
One way to deal with this is to program the scanner to replace FNC1 with space or another plain text character before sending it to your application. The scanner manufacturer usually provides a tool to produce programming bar codes that can do simple substitutions in the scanner. Then you can parse the data without having to handle special characters.