July 2018
Intermediate to advanced
354 pages
8h 51m
English
Modern ticketing solutions are more about barcodes and QR codes than the physical ticket. To create a life-like ticket application, I needed to create custom QR codes for each ticket. Again, a pair of node modules made this very straightforward: qr-encode (http://cryptocoinjs.com/modules/misc/qr-encode/) and ba64 (https://www.npmjs.com/package/ba64).
qr-encode converts strings into one of a variety of QR code options. The following code shows you how to use the qr method to generate dataURI:
let dataURI = qr(id, {
type: 6,
size: 6,
level: 'Q'
});
The qr method returns a base64 encoded data buffer. You still need to convert this into a physical file. This is where ba64 helps. It converts the base64 encoded buffer into ...
Read now
Unlock full access