QR code generator, supports Numeric, Alphanumeric and Binary inputMode up to lvl 40.
We use bower for dependency management. Add
dependencies: {
"qrcode": "latest"
}
To your bower.json
file. Then run
bower install
var qr = new QRCode(typeNumber, correction, inputMode);
qr.addData(text);
qr.make();
var modules = qr.getModuleCount();
for (var row = 0; row < modules; row++) {
for (var col = 0; col < modules; col++) {
var color = qr.isDark(row, col) ? '#000' : '#fff';
//...
}
}
- supported are all levels 1-40
- use 0 for the lowest complexity
- Integer 1 - Level L (Low)
- Integer 0 - Level M (Medium)
- Integer 3 - Level Q (Quartile)
- Integer 2 - Level H (High)
NUMBER
: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9ALPHA_NUM
: *0–9, A–Z (upper-case only), space, $, %, , +, -, ., /, :8bit
(default): ISO 8859-1
Kazuhiko Arase, http://www.d-project.com/
The MIT License
Copyright (c) 2013 Jan Antala