Anyone know of the logic to compute the Version of a QR code needed to encode data?

StackOverflow https://stackoverflow.com/questions/3769866

  •  04-10-2019
  •  | 
  •  

Question

The spec has 4 of these tables: http://www.denso-wave.com/qrcode/vertable1-e.html

to handle versions 1-40

I'm wondering if anyone has coded something to formulate calculating the version needed for a string of data. None of the libraries I've seen for encoding the data offer this.

Was it helpful?

Solution

http://code.google.com/p/jsqrencode/downloads/list

Inside is genframe that finds the smallest version that a string will fit in.

It doesn't really use a formula, simply tests linearly (maybe a bsearch would be faster). There is no algorithm or equation nor is one (compact) really possible since the tables use fixed values and aren't algorithmically generated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top