JavaScript QR Code Generator
Budget: €8 – €30 EUR
Need to create a javascript function `getQRMatrix`
```
function getQRMatrix( body: string ) {
...
return [
[0,1,...],
...
]
}
```
Parameter `body`: string for QR
Return value: array of arrays X × Y contens `0` or `1`
```
0 0 0 0 0 0 0 0 1 1 0 ...
0 0 0 0 0 0 0 0 0 1 0 ...
0 0 0 0 0 0 0 0 1 1 1 ...
...
```
Requirements:
- Minimal code size. The function should do only the functionality described, nothing more. And as a consequence, it should work as fast as possible. That's why the calculation parameters are fixed below so that they are not defined automatically
- Encoding modes - Binary UTF8
- Error correction level - M (15%)
- Version - 1
- Mask pattern - 2
- Vanila JS
- A single function that encapsulates all the logic. No third party libraries can be used
- Positioning and orientation blocks (squares 8 × 8 in 3 corners of the matrix) - all values `0`.
The ideal candidate must understand the agloritm of QR code creation.
Example of implementation: https://github.com/slesareva-gala/QR-Code. It allows generating such a array of arrays via matrix property, but it has a bunch of unnecessary stuff and positioning and orientation blocks are filled as they should be for QR code, but in my task statement they should be all `0`.
Link for the result checking: https://slesareva-gala.github.io/QR-Code/#eng.
For a clearer understanding of the task see this CodePen: https://codepen.io/maxmets/pen/RwzKMYM
```
function getQRMatrix( body: string ) {
...
return [
[0,1,...],
...
]
}
```
Parameter `body`: string for QR
Return value: array of arrays X × Y contens `0` or `1`
```
0 0 0 0 0 0 0 0 1 1 0 ...
0 0 0 0 0 0 0 0 0 1 0 ...
0 0 0 0 0 0 0 0 1 1 1 ...
...
```
Requirements:
- Minimal code size. The function should do only the functionality described, nothing more. And as a consequence, it should work as fast as possible. That's why the calculation parameters are fixed below so that they are not defined automatically
- Encoding modes - Binary UTF8
- Error correction level - M (15%)
- Version - 1
- Mask pattern - 2
- Vanila JS
- A single function that encapsulates all the logic. No third party libraries can be used
- Positioning and orientation blocks (squares 8 × 8 in 3 corners of the matrix) - all values `0`.
The ideal candidate must understand the agloritm of QR code creation.
Example of implementation: https://github.com/slesareva-gala/QR-Code. It allows generating such a array of arrays via matrix property, but it has a bunch of unnecessary stuff and positioning and orientation blocks are filled as they should be for QR code, but in my task statement they should be all `0`.
Link for the result checking: https://slesareva-gala.github.io/QR-Code/#eng.
For a clearer understanding of the task see this CodePen: https://codepen.io/maxmets/pen/RwzKMYM