Friday, August 26, 2016


Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp — Philip Greenspun 
Organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations — Melvin Conway

Sunday, August 14, 2016

Aztec Code generator in Python

When I was in Europe I've noticed unusual 2D barcodes printed on train tickets. These codes are called Aztec Code. I've already seen this code when played the CTF games.
I've decided to understand the principle of encoding and create Aztec code generator in Python. It shouldn't be so hard, because I've already understood the principles of QR Code encoding recently.
I've found a specification (surprisingly in Russian) describing the Aztec Code and created github repository. 
The most difficult part was to implement the algorithm of searching the optimal encoding sequence from the specification.
Source code of my version of Aztec code generator in Python on github:
Here are some resulting Aztec codes:
This is 71x71 Aztec code with 394 '\x00' bytes :

And this one is with 394 '\xff' bytes:

And here is 53x53 Aztec code with 433 "3" digits: