Structuring
This section is dedicated to section 8.6 in the specification.
Now that we have our data buffer and computed every CRC blocks, we just need to arange them. The technical term is called interleave. We are are taking our buffers columns by columns instead of rows, spreading our data. If the QRCode misses a quarter of data, it is still somewhere, thanks to the interleaving method.
GP1: [ 64,   0, 236,  17, 236,  17, 236,  17, 236,  17, 236]
GP1: [ 17, 236,  17, 236,  17, 236,  17, 236,  17, 236,  17]


GP2: [236,  17, 236,  17, 236,  17, 236,  17, 236,  17, 236,  17]
GP2: [236,  17, 236,  17, 236,  17, 236,  17, 236,  17, 236,  17]
And the error code associated:
DIV1: [204, 158, 218, 240, 157, 103, 216,  32, 194,  90,  54,  72,  65, 182,  36, 123,  73, 111, 109,  66,  17, 128]
DIV1: [222, 179,  20,  42, 196, 224, 167, 154, 173, 179, 219, 236,  53, 149, 123,  60, 206, 155, 101,  83,  29,  22]


DIV2: [104, 219, 225,  31, 120,  91, 193, 234, 157,  63, 191,   5, 131, 166, 141,   8,  62,  48, 214,  44,  46,  39]
DIV2: [104, 219, 225,  31, 120,  91, 193, 234, 157,  63, 191,   5, 131, 166, 141,   8,  62,  48, 214,  44,  46,  39]

You lay them as shown before and pick the first column of data, the second column of data until all columns are collected.
Then you do the same for the CRC blocks you made previously.
So we have:
Data:  [ 64,  17, 236, 236,   0, 236,  17,  17, 236,  17, 236, 236,  17, 236,  17,  17, 236,  17, 236, 236,  17, 236,  17,  17, 236,  17, 236, 236,  17, 236,  17,  17, 236,  17, 236, 236,  17, 236,  17,  17, 236,  17, 236, 236,  17,  17]
Error: [204, 222, 104, 104, 158, 179, 219, 219, 218,  20, 225, 225, 240,  42,  31,  31, 157, 196, 120, 120, 103, 224,  91,  91, 216, 167, 193, 193,  32, 154, 234, 234, 194, 173, 157, 157,  90, 179,  63,  63,  54, 219, 191, 191,  72, 236,   5,   5,  65,  53, 131, 131, 182, 149, 166, 166,  36, 123, 141, 141, 123,  60,   8,   8,  73, 206,  62,  62, 111, 155,  48,  48, 109, 101, 214, 214,  66,  83,  44,  44,  17,  29,  46,  46, 128,  22,  39,  39]
And then concatenate them:
[ 64,  17, 236, 236,   0, 236,  17,  17, 236,  17, 236, 236,  17, 236,  17,  17, 236,  17, 236, 236,  17, 236,  17,  17, 236,  17, 236, 236,  17, 236,  17,  17, 236,  17, 236, 236,  17, 236,  17,  17, 236,  17, 236, 236,  17,  17, 204, 222, 104, 104, 158, 179, 219, 219, 218,  20, 225, 225, 240,  42,  31,  31, 157, 196, 120, 120, 103, 224,  91,  91, 216, 167, 193, 193,  32, 154, 234, 234, 194, 173, 157, 157,  90, 179,  63,  63,  54, 219, 191, 191,  72, 236,   5,   5,  65,  53, 131, 131, 182, 149, 166, 166,  36, 123, 141, 141, 123,  60,   8,   8,  73, 206,  62,  62, 111, 155,  48,  48, 109, 101, 214, 214,  66,  83,  44,  44,  17,  29,  46,  46, 128,  22,  39,  39]
Recap:
We had from previous step many buffers and we just needed to structure them, and interleave them.
Made with 🚀 by erwanvivien
Catched a mistake ? Please make an issue