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

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