Javascript 我们可以在二维码中保存/存储多少数据/信息?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11065415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 04:16:30  来源:igfitidea点击:

How much data / information can we save / store in a QR code?

javascriptimagehtmlqr-code

提问by Daniel Ruf

I would like to use this script https://github.com/jeromeetienne/jquery-qrcode
(or is there even a better solution?)

我想使用这个脚本https://github.com/jeromeetienne/jquery-qrcode
(或者有更好的解决方案吗?)

What I like to do is "save" some small scripts or programs and even files like xml formatted files (svg, x3d, ...) as QR code images.

我喜欢做的是将一些小脚本或程序,甚至像 xml 格式的文件(svg、x3d、...)这样的文件“保存”为二维码图像。

But how much information (in bytes) can I save exactly to QR code images (using this javascript solution)?

但是我可以将多少信息(以字节为单位)准确保存到二维码图像中(使用这个 javascript 解决方案)?

Any experience with this script and using qr codes for files?
https://github.com/jeromeetienne/jquery-qrcode

有使用此脚本和使用文件二维码的经验吗?
https://github.com/jeromeetienne/jquery-qrcode

回答by free_easy

QR codes have three parameters: Datatype, size (number of 'pixels') and error correction level. How much information can be stored there also depends on these parameters. For example the lower the error correction level, the more information that can be stored, but the harder the code is to recognize for readers.

二维码具有三个参数:数据类型、大小(“像素”数)和纠错级别。在那里可以存储多少信息也取决于这些参数。例如,纠错级别越低,可以存储的信息越多,但代码越难被读者识别。

The maximum size and the lowest error correction give the following values:
Numeric only Max. 7,089 characters
Alphanumeric Max. 4,296 characters
Binary/byte Max. 2,953 characters (8-bit bytes)

最大大小和最低错误修正给出以下值:
仅数字最大。
最多7,089 个字符字母数字 4,296 个字符
二进制/字节最大。2,953 个字符(8 位字节)

回答by James

See this table.

请参阅此表

A 101x101 QR code, with high level error correction, can hold 3248 bits, or 406 bytes. Probably not enough for any meaningful SVG/XML data.

具有高级纠错功能的 101x101 QR 码可以容纳 3248 位或 406 个字节。对于任何有意义的 SVG/XML 数据可能还不够。

A 177x177 grid, depending on desired level of error correction, can store between 1273 and 2953 bytes. Maybe enough to store something small.

根据所需的纠错级别,177x177 网格可以存储 1273 到 2953 个字节。也许足以存储一些小东西。

enter image description here

在此处输入图片说明