Tobias Jamin於 2015年2月20日星期五 UTC+8下午5時06分42秒寫道:
Hi Tobias,
I have also done some works on embedding a lot of characters (>2,000) into a QR code and adding digital signature to the QR code.
From my experience, although the QR code standard allows storing 4,xxx characters into a QR code, in reality it is difficult to scan QR codes with version over 20 (~1000 alphanumeric or ~800 bytes of UTF-8 text).
The first problem is that the data modules are too small.
As the decoding algorithm assumes the QR code is printed on a 2D plane, a fold on the paper holding the QR code will displace the data modules and may make the scanner unable to read the modules correctly.
For normal QR codes we use today, as the modules are big, this kind of error can be ignored. For QR codes with version 20 or above, successful scanning usually comes from luck.
Hard-shaking makes the problem worse, you need to be very stable to take a clear image of the modules, especially when you save over 3,000 characters into a QR code.
One way to improve the performance is to detect the alignment patterns as references. It helps for QR codes with version 20-30. For version 30 or above, I am still looking for a robust method.
For the digital signature, we need to base64 encode the signature before embedding it into the QR code. For 1,024 bits RSA signature, it takes ~180 bytes. ECDSA may be a better option (supported from Android 4 and takes ~30 bytes only).
You may also consider saving some of the data in the scanner App to reduce the content of the QR code.