David Hofmann
David Hofmann

Reputation: 5775

How to Encode bits/bytes in 2D barcode in the most space-efficient way?

I am trying to squeeze the size of one of the popular barcodes to store around 580 bits, the output of this example. (i.e. an encrypted hash)

I need to make it work in datamatrix and pdf417

I know that I can convert to base64 but I want to know if there is a way to be more space efficient?

I control the writing and reading so i can use the encoding I choose.

Upvotes: 0

Views: 599

Answers (1)

silverpie
silverpie

Reputation: 66

If it's a proper hash, then all 256 values are equally likely, so using the Base256 mode in DataMatrix and PDF417 is the way to go. In DataMatrix—and also in Aztec Code—this is a control code followed by a length flag and a raw stream of bytes, just like the Byte mode in QR. In PDF417, it's a control code followed by packing of 6 bytes into 5 data points.

Upvotes: 2

Related Questions