diff options
author | Rebecca Turner <me@re-becca.org> | 2017-09-23 22:36:50 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-10-04 10:02:39 +0300 |
commit | 6a1aa06721cbb10644eab47558ca5bcb38df9155 (patch) | |
tree | fa2288b859a56d53ecd0690464ffb3189d83e61a /node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js | |
parent | ad1d6d1675719dd86235f7658cb4bc70206f2eaa (diff) |
qrcode-terminal@0.11.0
Diffstat (limited to 'node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js')
-rw-r--r-- | node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js b/node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js new file mode 100644 index 000000000..94bf74f0e --- /dev/null +++ b/node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js @@ -0,0 +1,22 @@ +var QRMode = require('./QRMode'); + +function QR8bitByte(data) { + this.mode = QRMode.MODE_8BIT_BYTE; + this.data = data; +} + +QR8bitByte.prototype = { + + getLength : function() { + return this.data.length; + }, + + write : function(buffer) { + for (var i = 0; i < this.data.length; i++) { + // not JIS ... + buffer.put(this.data.charCodeAt(i), 8); + } + } +}; + +module.exports = QR8bitByte; |