Bartalog / cool-maze

A quick mobile-to-desktop share capability, through matrix barcode
Apache License 2.0
2 stars 6 forks source link

Optimize QR-code complexity #51

Closed Deleplace closed 8 years ago

Deleplace commented 8 years ago

Try to have 21x21 blocks, instead of 25x25. Consider encoding channelID on 4 chars instead of 5, if it helps. Try different values of correctLevel when calling qrcode.js . Try if specifying "numeric chars only" helps.

Deleplace commented 8 years ago

Very related to issue #50 [Micro QR-code]

Deleplace commented 8 years ago

Possible error correction levels are L, M, Q, H. Default seems to be H.

Deleplace commented 8 years ago

Error correction "Level M (Medium) 15% of codewords can be restored" is enough for our use case, because the display won't be degraded except by the small red logo in the center.

This yields 21x21 QR-codes, which is the min we can reach with this library, however small the encoded data.

Deleplace commented 8 years ago

The new settings should theorically let us encode up to 34 decimal digits. The qrcodejs library however lets us encode only 11 "characters", and above yields 25x25 QR-code.

Well, 11 chars (maybe not only digits) should be enough anyway to have a wide range of difficult to guess values, e.g. 62^11 combinations or 72^11 or even more.

Deleplace commented 8 years ago

This discovery minimizes the QR-code size (21x21 is not that bad), but importantly it makes impracticable for an attacker to guess a random qrKey displayed by someone else.

Thus :

Deleplace commented 8 years ago

See big changes of #108