qrencode-raw

A node.js wrapper for libqrencode, but instead of encoding data to image, it
returns raw QR data in buffer, which allows you to do amazing things.
Install
You may need to install libqrencode-dev (>= 3.2) before install this package.
# Ubuntu
sudo apt-get install libqrencode-dev
# OS X
brew install libqrencode
npm install --save qrencode-raw
Usage
var QR = require('qrencode-raw');
var res = QR.encode(data, level, version);
- data string | Buffer data to encode, cannot be empty
- level QRecLevel error correction level:
QR.ECLEVEL_L
LowestQR.ECLEVEL_M
QR.ECLEVEL_Q
QR.ECLEVEL_H
Highest
- version int QR code version
0
auto1
~ 40
manually set
Result
{
version: 1,
width: 21,
data: <SlowBuffer ...>
}
- version int qr code version
- width int qr code width/height
- data Buffer qr code actual data, each byte represent a dot,
width * height bytes in total.
You can use bitwise AND with flags on each byte to extract info for that dot:
QR.DOT_BLACK
dot is black.QR.DOT_DATA_ECC
dot is part of data or ecc codeQR.DOT_FORMAT
dot is format infoQR.DOT_VERSION
dot is version infoQR.DOT_TIMING
dot is part of timing patternQR.DOT_ALIGN
dot is part of alignment patternQR.DOT_FINDER
dot is part of finder patternQR.DOT_NON_DATA
dot is non-data