Code 128 and retail barcodes
Stripes for the two jobs that want them: Code 128 for any text at all, and the three a till reads — EAN-13, UPC-A, EAN-8 — each with its last digit worked out rather than typed.
Data Matrix is what industry marks small parts with. It stays readable at sizes where a QR code has given up, and its rectangular shapes go onto components and labels that have no room for a square: a circuit board, a surgical instrument, a phial in a laboratory tray.
Choose Data Matrix when the room is tiny and what reads it is a machine rather than a person. It stays readable at sizes where a QR code has given up, and it goes down as a rectangle where a square will not fit — a strip along the edge of a board, a band round a phial. It is the code of factories, laboratories and hospitals rather than of customers: nobody points a telephone at one. Its size is not settled in advance either. It grows only as far as the text inside it needs, so a short reference comes out smaller than a long web address, and the page below shows both.
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.
Read the Rust source Read the Python source Read the JSON source
Stripes for the two jobs that want them: Code 128 for any text at all, and the three a till reads — EAN-13, UPC-A, EAN-8 — each with its last digit worked out rather than typed.
The code an invoice, a boarding pass or a label ends up wanting, drawn into the document rather than fetched as a picture and pasted in.
The code on identity documents and shipping papers: it carries far more text than a row of bars, and it survives a laser scanner dragged across it.
The code on rail and airline tickets, and the reason is room: it needs no band of white around it, which is the first thing trimmed off a layout that has run tight.
One picture fitted into a rectangle of one size eight ways: three ways of sizing it, the same one stood in the top left corner with a 12-point inset, a quarter turn left, a quarter turn right, a turn of 20 degrees, and a left-to-right mirror — every panel drawing the picture at the place and the size the library worked out.
A document made to be followed rather than looked at: every line of the contents lands on the page it names, and every page leads back to where it came from.