Skip to content
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

How to get QR Code version, error correction level, and mask? #23

Closed
winnie19970218 opened this issue Mar 30, 2022 · 4 comments
Closed

Comments

@winnie19970218
Copy link

No description provided.

@winnie19970218
Copy link
Author

Hello, I didn't see any API can get the QR Code version, error correction level, and mask.

@dlenski
Copy link
Owner

dlenski commented Mar 30, 2022

This is a wrapper around the ZXing command-line runner, and it can't extract any information that the ZXing CLR can't show.

any API can get the QR Code version, error correction level, and mask.

I'm curious: why would you want that information while reading a barcode? The whole point of error correction is to be able to transparently and correctly return the originally-encoded string in the face of variable errors while reading the barcode.

@winnie19970218
Copy link
Author

I made a verification system, the decoder needs to know that the QR code is generated by my program when decoding, so I add the detailed information of the QR code to the database when generating the QR code. By comparing the information obtained by the decoder with the database, you can know whether the QR code is unverified.
There is a class name called Version.java in [com.google.zxing.qrcode.decoder], this class can get the QR code version.

@dlenski
Copy link
Owner

dlenski commented Apr 21, 2022

I made a verification system, the decoder needs to know that the QR code is generated by my program when decoding, so I add the detailed information of the QR code to the database when generating the QR code. By comparing the information obtained by the decoder with the database, you can know whether the QR code is unverified.

This sounds like it's half steganography, half security through obscurity. Altogether, it seems like it will provide no security, but may prevent the QR codes from being decoded reliably.

The whole point of error correction is that sometimes the QR code will not be read back perfectly.

There is a class name called Version.java in [com.google.zxing.qrcode.decoder], this class can get the QR code version.

Per above, you would have to extend the ZXing command-line runner to output this information to allow python-zxing to read it.

@dlenski dlenski closed this as completed Aug 24, 2022
Repository owner locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants