ETOOBUSY 🚀 minimal blogging for the impatient
A wrapper around Text::QRCode to print QR codes on the terminal.
The output of that module is a bit weird, in that it is a 2-dimensional
matrix (array of arrays) where each cell contains a single character,
that can be either a star
* or a blank space.
I think it’s weird because I would have expected…
- … arrays of
0(or otherwise true and false values), OR
- … an array of strings for each line, OR
- … a single string with nelines inside.
I thought to use the Unicode characters discovered from QRcode.show to produce something good for the terminal:
The input is the encoded form produced by Text::QRCode, and the output is an array of lines.
A few remarks:
- each pair if input lines of pixels is encoded into a single line of characters, to account for the difference in width vs. height in the terminal (this is somehow the opposite choice taken by Term::QRCode, where each input pixel is represented by two characters);
- we’re adding the quiet zone around the produced output, to avoid confusing the decoders.
Pretty neat, uh?
I guess it’s all for today… stay safe folks!