8BitByte.js 383 B

1234567891011121314151617181920212223
  1. var mode = require('./mode');
  2. function QR8bitByte(data) {
  3. this.mode = mode.MODE_8BIT_BYTE;
  4. this.data = data;
  5. }
  6. QR8bitByte.prototype = {
  7. getLength : function(buffer) {
  8. return this.data.length;
  9. },
  10. write : function(buffer) {
  11. for (var i = 0; i < this.data.length; i++) {
  12. // not JIS ...
  13. buffer.put(this.data.charCodeAt(i), 8);
  14. }
  15. }
  16. };
  17. module.exports = QR8bitByte;