开发者

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

开发者 https://www.devze.com 2023-01-17 16:26 出处:网络
The spec has 4 of these tables: http://www.denso-wave.com/qrcode/vertable1-e.html to handle versions 1-40

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 someth开发者_运维知识库ing to formulate calculating the version needed for a string of data. None of the libraries I've seen for encoding the data offer this.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消