qrcode-generator-ts
Version:
Typescript QR Code generator based on https://github.com/kazuhikoarase/qrcode-generator
28 lines • 1.03 kB
JavaScript
;
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var QRCode_1 = require('./QRCode');
var QRData_1 = require('./QRData');
var Mode_1 = require('./Mode');
;
var QR8BitByte = (function (_super) {
__extends(QR8BitByte, _super);
function QR8BitByte(data) {
_super.call(this, Mode_1.Mode.MODE_8BIT_BYTE, data);
}
QR8BitByte.prototype.write = function (buffer) {
var data = QRCode_1.QRCode.stringToBytes(this.getData());
for (var i = 0; i < data.length; i += 1) {
buffer.put(data[i], 8);
}
};
QR8BitByte.prototype.getLength = function () {
return QRCode_1.QRCode.stringToBytes(this.getData()).length;
};
return QR8BitByte;
}(QRData_1.QRData));
exports.QR8BitByte = QR8BitByte;
//# sourceMappingURL=QR8BitByte.js.map