Re: Driver for the :Cue:Cat barcode reader

From: Michael Rothwell (
Date: Sat Aug 26 2000 - 02:13:27 EST

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

Taral ( wrote the original version in python
(, and I've converted it to
perl ( and 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
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
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
Please read the FAQ at

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