-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zlib header form aztec is different #2
Comments
I'm not a maintainer of the project, but interested in the ticket data. Could you upload a sample ticket? |
Another idea: Which lib/tool do you use for reading the barcode. I had some troubles with 'zxing' (and all other libs using zxing) due to the encoding. I fixed it like this (sure not the best way): var iconv = require('iconv-lite')
function fixingZXing (buffer) {
const latin1str = iconv.decode(buffer.toString('utf-8'), 'ISO-8859-1')
return Buffer.from(latin1str, 'latin1')
} |
The barcode isn't a The specs of this format are published here (German only). const extractAztec = require('ot-aztec-extract');
const zxing = require('zebra-crossing');
const TicketParser = require('ticket-parser');
const iconv = require('iconv-lite');
const fs = require('fs');
function read(pdfPath) {
return extractAztec(fs.readFileSync(pdfPath))
.then(png => zxing.read(png, { pureBarcode: true }))
.then(data => iconv.encode(data.raw, 'latin1'))
.then(x => console.log(x.toString()))
}
read('./flt-3ww74b4100-0.pdf') Output (look for
|
TIL, because of course there’s a separate format. Thanks for diagnosing this, @justusjonas74! |
Anyone interested in a lib for parsing this format? I guess it's a bit more complex than the UIC barcode... |
We have a decoder for the VDV format here now: https://github.com/KDE/kitinerary/tree/master/src/vdv, that at least gets you past the crypto to the actual payload. There's a number of operator-specific numbers and codes in there that this can't translate yet, but it for example finds some privacy-relevant details in the above sample, such as name, gender and birthdate. |
That’s great news! Do you think it would make sense to include VDV compatibility in this library? In that case I’d be grateful for any help because I have no experience with linking to non-JS libraries and no longer live in Germany (which makes testing difficult and dependent on donated data). I suppose there might also be an incompatibility between the MIT and GNU licences. As a precaution, I’ve removed this comment by @jurkov due to potential personal data in the linked PDF:
Originally posted by @jurkov in #2 (comment) |
I have no idea about the integration, neither technically nor from a use-case POV, sorry. I mainly posted this here as this is one of the very few public discussions on this subject I found while digging into this. |
Thanks! As I have neither the know-how nor much of a use-case, I’ll add a few words to the readme in the hopes of pointing people in the direction of this discussion. Pull requests are gladly accepted! |
As I am fighting with some project related to reading and parsing data of VDV ticket. Can I kindly ask you to share your solution again? I can see that is no longer avalible for some reason :( |
I am working on that as my job project, but I think it would be extremely useful if we could share this lib as open source. Let me know if interested :) |
Hello,
the zlib header of my tickets are 0x78, 0x3f and not 0x78, 0x9c. Do you have any idea how to decode the content?
The text was updated successfully, but these errors were encountered: