有人知道计算编码数据所需的二维码版本的逻辑吗?

发布于 2024-09-24 04:04:43 字数 230 浏览 3 评论 0原文

该规范有 4 个这样的表: http://www.denso-wave.com/qrcode/vertable1-e。 制定

我想知道是否有人编写了一些代码来

计算一串数据所需的版本。我见过的用于编码数据的库都没有提供此功能。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇纵 2024-10-01 04:04:43

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

里面是 genframe,它找到适合字符串的最小版本。

它并不真正使用公式,只是线性测试(也许 bsearch 会更快)。没有算法或方程,也不可能真正实现(紧凑),因为表格使用固定值并且不是通过算法生成的。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文