Live data from Hacker News

Reading QR codes without a computer

qr.blinry.org

71–80 of 93 posts

Re: Reading QR codes without a computer

#72
Great article, loved it.

>For the ASCII encoding mode

What's this encoding mode? There's no mention of an ASCII "encoding mode" in the rest of the article. wtf? Did you mean "bytes"?

>bytes case

Suppose it's not bytes, but any of the other modes. How do we read these?

>The error correction is generated by some fancy math, and we don't care about it

Please include error correction. Even if reading by hand, I want to know if I read properly! For that, I need to calculate the error correction.

Even just saying "there's a CRC-32/ISO-HDLC here" is better than saying nothing. I understand CRC is outside the scope of the article.

Re: Reading QR codes without a computer

#73
post #72

Great article, loved it. >For the ASCII encoding mode What's this encoding mode? There's no mention of an ASCII "encoding mode" in the rest of the article. wtf? Did you mean "bytes"? >bytes case Suppose it's not bytes, but any of the other modes. How do we read these? >The error correction is generated by some fancy math, and we don't care about it Please include error correction. Even if reading by hand, I want to k…

The modes are discussed in the article.

Re: Reading QR codes without a computer

#74
How could two-dimensional codes have been designed to be human-readable?

I was hoping to learn from the article how to manually read QR codes, but that format, at least, is much too complex to do with any efficiency.

At the end of the day, it's bits. Simplist case: 7-bit ASCII; eliminate masks (is that really so difficult for modern software to read sans the masks?); put error correction, length etc. in some corner where humans can ignore them ...

Re: Reading QR codes without a computer

#76

Earlier quoted context omitted.

When I worked at a grocery store in the 2000s, you didn't need the checksum digit when keying in a barcode by hand. In fact, manually entering the checksum digit would result in a "product not found" error. So I wonder if the checker had to manually look anything up, assuming it was only the checksum digit that was frayed off. Perhaps some POS systems do require the checksum digit for manually-entered barcodes, thoug…

>In fact, manually entering the checksum digit would result in a "product not found" error. That is hilarious to me. The obviously safer approach of checking the check digit was not merely neglected, but actively forbidden.

It is possible that a check digit could happen to be incorrect from the beginning. This (and more rarely, an accidental code reuse) does happen fairly commonly with ISBN, so I would expect the same for general UPC/EAN.

Re: Reading QR codes without a computer

#77
post #55
post #5

Slightly off topic: One day in the late 90s or early 2000s, I wanted to transfer the contents of my Atari 8-bit disks to my PC. I did know about SIO2PC, a cable that converts between Atari's SIO port and the PC's serial port and a piece of software to go with it. But I didn't have the electronics skills to build one (even though it is actually very easy). So I ended up writing a Basic program on the Atari to read dat…

I think there's definitely a future for this type of data exfiltration via display as otherwise locked-down systems become more common.

https://www.robots-everywhere.com/re_wiki/pmwiki.php?n=Main.... I gotta fix my wiki.... https://www.robots-everywhere.com/re_wiki/images/Derpserial....

Re: Reading QR codes without a computer

#78
post #32

Wonderful write up, thank you! One question I’ve been trying to answer: I’ve been seeing more QR codes in the wild using dots instead of squares, and rounded edges instead of hard corners. All my research suggests these are reader implementation specific and not guaranteed to work per the official spec. But I find it hard to believe these codes are becoming more prevalent if they aren’t guaranteed to read. Anyone hav…

The qr code scanning algorithm works based on contrast and is designed to work with poor cameras under poor light conditions. Whatever shapes, colors and shades are used are interpreted as either black or white squares.

The process starts by scanning for the 3 markers on the corners. That give you the square containing the qr content and it's orientation. The next jobs are figuring out the resolution of the square and the version of the qr code used. Eventually you end up knowing the grid dimensions. And then you simply scan the grid as the article outlines by simply averaging the pixels in each grid square to be "white" or "black". As long as you have enough contrast, most grid squares will scan correctly.

You can abuse this quite a bit before it starts breaking. There are some interesting QR codes out there that are barely recognizable as QR codes for people. But if you open them in an image editor and play with the levels and contrast a bit, they are obviously qr codes. And there's error correction too so it's OK if some of the qr code is scanned incorrectly.

Re: Reading QR codes without a computer

#79
post #20

Earlier quoted context omitted.

Barcodes use the last digit as a checksum. The checksum is some adding up the numbers and multiplying or something, then % 10 (only 0-9 possible values). As you can see with this math, the error checking has a 1/10 of a chance of coincidentally showing a correct checksum in cases where the data is incorrect. Either way, that last digit on barcodes is insignificant to the actual product's unique barcode ID. Fun story:…

When I worked at a grocery store in the 2000s, you didn't need the checksum digit when keying in a barcode by hand. In fact, manually entering the checksum digit would result in a "product not found" error. So I wonder if the checker had to manually look anything up, assuming it was only the checksum digit that was frayed off. Perhaps some POS systems do require the checksum digit for manually-entered barcodes, thoug…

As a grocery checker, I also remember not typing the checksum. It isn't part of the product's ID, but manually typing in probably has a higher chance of error than scanning so what the heck??

Another fun fact: in the intro to The Simpsons, Maggie gets scanned by the clerk as a valid item with a price shown on the register.

Re: Reading QR codes without a computer

#80
post #72

Great article, loved it. >For the ASCII encoding mode What's this encoding mode? There's no mention of an ASCII "encoding mode" in the rest of the article. wtf? Did you mean "bytes"? >bytes case Suppose it's not bytes, but any of the other modes. How do we read these? >The error correction is generated by some fancy math, and we don't care about it Please include error correction. Even if reading by hand, I want to k…

The modes are discussed in the article.

>The modes are discussed in the article.

Yes, and it lists encoding modes Numeric, Alphanumeric, Byte, ECI, and Kanji. It then proceeds to focus on Byte.

Article does notably not list an "encoding mode" called ASCII.

Thus, there's an issue in the article.

Post reply on HN