Re: Driver for the :Cue:Cat barcode reader

From: Michael Rothwell (rothwell@holly-springs.nc.us)
Date: Sat Aug 26 2000 - 02:13:27 EST


There is a better way to decode CueCat output. Colin Cross sent me this
info:

Taral (taral@taral.net) wrote the original version in python
(http://ccwf.cc.utexas.edu/~taral/cat.py), and I've converted it to
perl (http://www.mit.edu/~colin/cat.pl) and C
(http://www.mit.edu/~colin/cat.c).

It's a rather simple formula: each character is a base-64 (6-bit)
number ('a'
to 'z' is 0 to 25, 'A' to 'Z' is 26 to 51, '0' to '9' is 52 to 61, '+'
is 62,
'-'is 63). The 4 6-bit numbers are combined into a single 24-bit
number,
which is split into 3 8-bit numbers. Each 8-bit number is XOR'd with 67
(decimal) to produce the final ASCII code.

Not quite sure how Taral figured it out, but it works well, decodes
alphanumeric codes (such as the UPS tracking numbers), and produces
useful
data out of the type codes (128 for a Code-128, UPA for a UPC-A, etc.)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:17 EST