lkml.org 
[lkml]   [2000]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Driver for the :Cue:Cat barcode reader
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/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.026 / U:2.652 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site