生成条形码时,字符数有限制吗?

发布于 2024-10-12 20:29:03 字数 192 浏览 3 评论 0原文

我必须开发一个系统来生成要打印的条形码,并且想知道条形码的字符数是否有限制?我打算使用 PHP 来实现这一点,使用 QR 码是否会更好?

编辑

我想为一个存储不同类型鞋子的系统做这个条形码,但由于鞋子有很多变化,我需要更多的字符,但我想我可以使用十六进制数字来创建条形码(不确定这是否可能,我正在研究)

I have to develop a system that generates barcodes that will be printed and was wondering if there's a limit to the number of characters of a barcode? I intend to make this using PHP, also would it be better in some way to use QR codes?

EDIT

I want to do this barcodes for a system that will stor different types of shoes but since there are lots of variations to the shoes I require some more characters, but I think I can use hexadecimal numbers to create the barcodes (not sure if this is possible I'm looking into it)

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

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

发布评论

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

评论(2

财迷小姐 2024-10-19 20:29:03

所有条形码对其可以表示的字符数(或者最常见的是数字)都有一定的限制 - 您不会期望任何类型的条形码能够容纳无限量的数据,不是吗? ;)

多种条形码,有些甚至具有可变长度。

发出条形码并不像您想象的那么简单,您可能必须:

  • 使用校验和算法
  • 遵循预定义的“命名空间”(ISBN)
  • 使用 GS1 或类似的监管机构注册您自己的命名空间

QR 码和 Semacode 是二维的,这使得打乱它们所保存的数据变得更加困难,而且我几乎可以肯定它们不受监管,但它们也更难生成。

有关您想要做什么(以及为什么)的更多信息将会有所帮助,否则您可能不会得到任何像样的答案。


一些思考:

All barcodes have some limit on the number of characters (or, most commonly, digits) they can represent - you wouldn't expect any kind of barcode to hold an infinite amount of data, would you? ;)

There are many kinds of barcodes, some even have variable lengths.

Emitting barcodes is not as simple as you may think, you'd probably have to:

  • use a checksum algorithm
  • follow the predifined "namespaces" (ISBN comes to mind)
  • register your own namespace with GS1 or a similar regulating body

QR Codes and Semacodes are two-dimensional, this makes it harder to scramble the data they hold and I'm almost sure they are not regulated, but they are also a bit harder to generate.

Some more information about what (and why) you want to do would be helpful, otherwise you probably won't get any decent answers.


Some food for thought:

  • will these barcodes be used internally? if not, how will you make sure your barcode isn't misinterpreted by another product which happens to share the same code?
  • I might be wrong, but you can only use digits (and maybe X for the check digit) with the GTIN family of barcodes - more importantly, why would you need more than the 0-9 charset? even a 8-digit barcode provides 7^10 (282.475.249) different codes... Do you really have that many shoes?
  • have you considered generating Semacodes instead? They allow direct URL routing and can be read by most cellphones nowadays - wouldn't such a system be enough for your needs?
隔纱相望 2024-10-19 20:29:03

当然,字符数是有限制的。普通条形码通常可以编码大约 12 位数字或少量数据。二维码通常可以存储几千字节的数据。这一切都取决于您选择的条形码/矩阵码的类型。这很可能取决于谁会阅读这些代码。

概述如下:http://en.wikipedia.org/wiki/Barcode#Types_of_barcodes

Of course there's a limit on the number of characters. Normal barcodes can usually encode somewhere around 12 digits or a handful of bits of data. Two dimensional codes can typically store a few thousand bytes of data. This all depends on the type of barcode/matrix code you choose. And this most likely depends on who will read these codes.

Here's an overview: http://en.wikipedia.org/wiki/Barcode#Types_of_barcodes

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