You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
36 KiB

{"ast":null,"code":"var BitByte = require('./8BitByte');\n\nvar RSBlock = require('./RSBlock');\n\nvar BitBuffer = require('./BitBuffer');\n\nvar util = require('./util');\n\nvar Polynomial = require('./Polynomial');\n\nfunction QRCode(typeNumber, errorCorrectLevel) {\n this.typeNumber = typeNumber;\n this.errorCorrectLevel = errorCorrectLevel;\n this.modules = null;\n this.moduleCount = 0;\n this.dataCache = null;\n this.dataList = [];\n} // for client side minification\n\n\nvar proto = QRCode.prototype;\n\nproto.addData = function (data) {\n var newData = new BitByte(data);\n this.dataList.push(newData);\n this.dataCache = null;\n};\n\nproto.isDark = function (row, col) {\n if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {\n throw new Error(row + \",\" + col);\n }\n\n return this.modules[row][col];\n};\n\nproto.getModuleCount = function () {\n return this.moduleCount;\n};\n\nproto.make = function () {\n // Calculate automatically typeNumber if provided is < 1\n if (this.typeNumber < 1) {\n var typeNumber = 1;\n\n for (typeNumber = 1; typeNumber < 40; typeNumber++) {\n var rsBlocks = RSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);\n var buffer = new BitBuffer();\n var totalDataCount = 0;\n\n for (var i = 0; i < rsBlocks.length; i++) {\n totalDataCount += rsBlocks[i].dataCount;\n }\n\n for (var i = 0; i < this.dataList.length; i++) {\n var data = this.dataList[i];\n buffer.put(data.mode, 4);\n buffer.put(data.getLength(), util.getLengthInBits(data.mode, typeNumber));\n data.write(buffer);\n }\n\n if (buffer.getLengthInBits() <= totalDataCount * 8) break;\n }\n\n this.typeNumber = typeNumber;\n }\n\n this.makeImpl(false, this.getBestMaskPattern());\n};\n\nproto.makeImpl = function (test, maskPattern) {\n this.moduleCount = this.typeNumber * 4 + 17;\n this.modules = new Array(this.moduleCount);\n\n for (var row = 0; row < this.moduleCount; row++) {\n this.modules[row] = new Array(this.moduleCount);\n\n for (var col = 0; col < this.moduleCount; col++) {\n this.modules[row][col] = null; //(col + row) % 3;\n }\n }\n\n this.setupPositionProbePattern(0, 0);\n this.setupPositionProbePattern(this.moduleCount - 7, 0);\n this.setupPositionProbePattern(0, this.moduleCount - 7);\n this.setupPositionAdjustPattern();\n this.setupTimingPattern();\n this.setupTypeInfo(test, maskPattern);\n\n if (this.typeNumber >= 7) {\n this.setupTypeNumber(test);\n }\n\n if (this.dataCache == null) {\n this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);\n }\n\n this.mapData(this.dataCache, maskPattern);\n};\n\nproto.setupPositionProbePattern = function (row, col) {\n for (var r = -1; r <= 7; r++) {\n if (row + r <= -1 || this.moduleCount <= row + r) continue;\n\n for (var c = -1; c <= 7; c++) {\n if (col + c <= -1 || this.moduleCount <= col + c) continue;\n\n if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {\n this.modules[row + r][col + c] = true;\n } else {\n this.modules[row + r][col + c] = false;\n }\n }\n }\n};\n\nproto.getBestMaskPattern = function () {\n var minLostPoint = 0;\n var pattern = 0;\n\n for (var i = 0; i < 8; i++) {\n this.makeImpl(true, i);\n var lostPoint = util.getLostPoint(this);\n\n if (i == 0 || minLostPoint > lostPoint) {\n minLostPoint = lostPoint;\n pattern = i;\n }\n }\n\n return pattern;\n};\n\nproto.createMovieClip = function (target_mc, instance_name, depth) {\n var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);\n var cs = 1;\n this.make();\n\n for (var row = 0; row < this.modules.length; row++) {\n var y = row * cs;\n\n for (var col = 0; col < this.modules[row].length; col++) {\n var x = col * cs;\n var dark = this.modules[row][col];\n\n if (dark) {\n qr_mc.beginFill(0, 100);\n qr_mc.moveTo(x, y);\n qr_mc.lineTo(x + cs, y);\n qr_mc.lineTo(x + cs, y + cs);\n qr_mc.lineTo(x, y + cs);\n qr_mc.endFill();\n }\n }\n }\n\n return qr_mc;\n};\n\nproto.setupTimingPattern = function () {\n for (var r = 8; r < this.moduleCount - 8; r++) {\n if (this.modules[r][6] != null) {\n continue;\n }\n\n this.modules[r][6] = r % 2 == 0;\n }\n\n for (var c = 8; c < this.moduleCount - 8; c++) {\n if (this.modules[6][c] != null) {\n continue;\n }\n\n this.modules[6][c] = c % 2 == 0;\n }\n};\n\nproto.setupPositionAdjustPattern = function () {\n var pos = util.getPatternPosition(this.typeNumber);\n\n for (var i = 0; i < pos.length; i++) {\n for (var j = 0; j < pos.length; j++) {\n var row = pos[i];\n var col = pos[j];\n\n if (this.modules[row][col] != null) {\n continue;\n }\n\n for (var r = -2; r <= 2; r++) {\n for (var c = -2; c <= 2; c++) {\n if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {\n this.modules[row + r][col + c] = true;\n } else {\n this.modules[row + r][col + c] = false;\n }\n }\n }\n }\n }\n};\n\nproto.setupTypeNumber = function (test) {\n var bits = util.getBCHTypeNumber(this.typeNumber);\n\n for (var i = 0; i < 18; i++) {\n var mod = !test && (bits >> i & 1) == 1;\n this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;\n }\n\n for (var i = 0; i < 18; i++) {\n var mod = !test && (bits >> i & 1) == 1;\n this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;\n }\n};\n\nproto.setupTypeInfo = function (test, maskPattern) {\n var data = this.errorCorrectLevel << 3 | maskPattern;\n var bits = util.getBCHTypeInfo(data); // vertical\t\t\n\n for (var i = 0; i < 15; i++) {\n var mod = !test && (bits >> i & 1) == 1;\n\n if (i < 6) {\n this.modules[i][8] = mod;\n } else if (i < 8) {\n this.modules[i + 1][8] = mod;\n } else {\n this.modules[this.moduleCount - 15 + i][8] = mod;\n }\n } // horizontal\n\n\n for (var i = 0; i < 15; i++) {\n var mod = !test && (bits >> i & 1) == 1;\n\n if (i < 8) {\n this.modules[8][this.moduleCount - i - 1] = mod;\n } else if (i < 9) {\n this.modules[8][15 - i - 1 + 1] = mod;\n } else {\n this.modules[8][15 - i - 1] = mod;\n }\n } // fixed module\n\n\n this.modules[this.moduleCount - 8][8] = !test;\n};\n\nproto.mapData = function (data, maskPattern) {\n var inc = -1;\n var row = this.moduleCount - 1;\n var bitIndex = 7;\n var byteIndex = 0;\n\n for (var col = this.moduleCount - 1; col > 0; col -= 2) {\n if (col == 6) col--;\n\n while (true) {\n for (var c = 0; c < 2; c++) {\n if (this.modules[row][col - c] == null) {\n var dark = false;\n\n if (byteIndex < data.length) {\n dark = (data[byteIndex] >>> bitIndex & 1) == 1;\n }\n\n var mask = util.getMask(maskPattern, row, col - c);\n\n if (mask) {\n dark = !dark;\n }\n\n this.modules[row][col - c] = dark;\n bitIndex--;\n\n if (bitIndex == -1) {\n byteIndex++;\n bitIndex = 7;\n }\n }\n }\n\n row += inc;\n\n if (row < 0 || this.moduleCount <= row) {\n row -= inc;\n inc = -inc;\n break;\n }\n }\n }\n};\n\nQRCode.PAD0 = 0xEC;\nQRCode.PAD1 = 0x11;\n\nQRCode.createData = function (typeNumber, errorCorrectLevel, dataList) {\n var rsBlocks = RSBlock.getRSBlocks(typeNumber, errorCorrectLevel);\n var buffer = new BitBuffer();\n\n for (var i = 0; i < dataList.length; i++) {\n var data = dataList[i];\n buffer.put(data.mode, 4);\n buffer.put(data.getLength(), util.getLengthInBits(data.mode, typeNumber));\n data.write(buffer);\n } // calc num max data.\n\n\n var totalDataCount = 0;\n\n for (var i = 0; i < rsBlocks.length; i++) {\n totalDataCount += rsBlocks[i].dataCount;\n }\n\n if (buffer.getLengthInBits() > totalDataCount * 8) {\n throw new Error(\"code length overflow. (\" + buffer.getLengthInBits() + \">\" + totalDataCount * 8 + \")\");\n } // end code\n\n\n if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {\n buffer.put(0, 4);\n } // padding\n\n\n while (buffer.getLengthInBits() % 8 != 0) {\n buffer.putBit(false);\n } // padding\n\n\n while (true) {\n if (buffer.getLengthInBits() >= totalDataCount * 8) {\n break;\n }\n\n buffer.put(QRCode.PAD0, 8);\n\n if (buffer.getLengthInBits() >= totalDataCount * 8) {\n break;\n }\n\n buffer.put(QRCode.PAD1, 8);\n }\n\n return QRCode.createBytes(buffer, rsBlocks);\n};\n\nQRCode.createBytes = function (buffer, rsBlocks) {\n var offset = 0;\n var maxDcCount = 0;\n var maxEcCount = 0;\n var dcdata = new Array(rsBlocks.length);\n var ecdata = new Array(rsBlocks.length);\n\n for (var r = 0; r < rsBlocks.length; r++) {\n var dcCount = rsBlocks[r].dataCount;\n var ecCount = rsBlocks[r].totalCount - dcCount;\n maxDcCount = Math.max(maxDcCount, dcCount);\n maxEcCount = Math.max(maxEcCount, ecCount);\n dcdata[r] = new Array(dcCount);\n\n for (var i = 0; i < dcdata[r].length; i++) {\n dcdata[r][i] = 0xff & buffer.buffer[i + offset];\n }\n\n offset += dcCount;\n var rsPoly = util.getErrorCorrectPolynomial(ecCount);\n var rawPoly = new Polynomial(dcdata[r], rsPoly.getLength() - 1);\n var modPoly = rawPoly.mod(rsPoly);\n ecdata[r] = new Array(rsPoly.getLength() - 1);\n\n for (var i = 0; i < ecdata[r].length; i++) {\n var modIndex = i + modPoly.getLength() - ecdata[r].length;\n ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;\n }\n }\n\n var totalCodeCount = 0;\n\n for (var i = 0; i < rsBlocks.length; i++) {\n totalCodeCount += rsBlocks[i].totalCount;\n }\n\n var data = new Array(totalCodeCount);\n var index = 0;\n\n for (var i = 0; i < maxDcCount; i++) {\n for (var r = 0; r < rsBlocks.length; r++) {\n if (i < dcdata[r].length) {\n data[index++] = dcdata[r][i];\n }\n }\n }\n\n for (var i = 0; i < maxEcCount; i++) {\n for (var r = 0; r < rsBlocks.length; r++) {\n if (i < ecdata[r].length) {\n data[index++] = ecdata[r][i];\n }\n }\n }\n\n return data;\n};\n\nmodule.exports = QRCode;","map":{"version":3,"names":["BitByte","require","RSBlock","BitBuffer","util","Polynomial","QRCode","typeNumber","errorCorrectLevel","modules","moduleCount","dataCache","dataList","proto","prototype","addData","data","newData","push","isDark","row","col","Error","getModuleCount","make","rsBlocks","getRSBlocks","buffer","totalDataCount","i","length","dataCount","put","mode","getLength","getLengthInBits","write","makeImpl","getBestMaskPattern","test","maskPattern","Array","setupPositionProbePattern","setupPositionAdjustPattern","setupTimingPattern","setupTypeInfo","setupTypeNumber","createData","mapData","r","c","minLostPoint","pattern","lostPoint","getLostPoint","createMovieClip","target_mc","instance_name","depth","qr_mc","createEmptyMovieClip","cs","y","x","dark","beginFill","moveTo","lineTo","endFill","pos","getPatternPosition","j","bits","getBCHTypeNumber","mod","Math","floor","getBCHTypeInfo","inc","bitIndex","byteIndex","mask","getMask","PAD0","PAD1","putBit","createBytes","offset","maxDcCount","maxEcCount","dcdata","ecdata","dcCount","ecCount","totalCount","max","rsPoly","getErrorCorrectPolynomial","rawPoly","modPoly","modIndex","get","totalCodeCount","index","module","exports"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/qr.js/lib/QRCode.js"],"sourcesContent":["var BitByte = require('./8BitByte');\nvar RSBlock = require('./RSBlock');\nvar BitBuffer = require('./BitBuffer');\nvar util = require('./util');\nvar Polynomial = require('./Polynomial');\n\nfunction QRCode(typeNumber, errorCorrectLevel) {\n\tthis.typeNumber = typeNumber;\n\tthis.errorCorrectLevel = errorCorrectLevel;\n\tthis.modules = null;\n\tthis.moduleCount = 0;\n\tthis.dataCache = null;\n\tthis.dataList = [];\n}\n\n// for client side minification\nvar proto = QRCode.prototype;\n\nproto.addData = function(data) {\n\tvar newData = new BitByte(data);\n\tthis.dataList.push(newData);\n\tthis.dataCache = null;\n};\n\nproto.isDark = function(row, col) {\n\tif (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {\n\t\tthrow new Error(row + \",\" + col);\n\t}\n\treturn this.modules[row][col];\n};\n\nproto.getModuleCount = function() {\n\treturn this.moduleCount;\n};\n\nproto.make = function() {\n\t// Calculate automatically typeNumber if provided is < 1\n\tif (this.typeNumber < 1 ){\n\t\tvar typeNumber = 1;\n\t\tfor (typeNumber = 1; typeNumber < 40; typeNumber++) {\n\t\t\tvar rsBlocks = RSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);\n\n\t\t\tvar buffer = new BitBuffer();\n\t\t\tvar totalDataCount = 0;\n\t\t\tfor (var i = 0; i < rsBlocks.length; i++) {\n\t\t\t\ttotalDataCount += rsBlocks[i].dataCount;\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < this.dataList.length; i++) {\n\t\t\t\tvar data = this.dataList[i];\n\t\t\t\tbuffer.put(data.mode, 4);\n\t\t\t\tbuffer.put(data.getLength(), util.getLengthInBits(data.mode, typeNumber) );\n\t\t\t\tdata.write(buffer);\n\t\t\t}\n\t\t\tif (buffer.getLengthInBits() <= totalDataCount * 8)\n\t\t\t\tbreak;\n\t\t}\n\t\tthis.typeNumber = typeNumber;\n\t}\n\tthis.makeImpl(false, this.getBestMaskPattern() );\n};\n\nproto.makeImpl = function(test, maskPattern) {\n\t\n\tthis.moduleCount = this.typeNumber * 4 + 17;\n\tthis.modules = new Array(this.moduleCount);\n\t\n\tfor (var row = 0; row < this.moduleCount; row++) {\n\t\t\n\t\tthis.modules[row] = new Array(this.moduleCount);\n\t\t\n\t\tfor (var col = 0; col < this.moduleCount; col++) {\n\t\t\tthis.modules[row][col] = null;//(col + row) % 3;\n\t\t}\n\t}\n\n\tthis.setupPositionProbePattern(0, 0);\n\tthis.setupPositionProbePattern(this.moduleCount - 7, 0);\n\tthis.setupPositionProbePattern(0, this.moduleCount - 7);\n\tthis.setupPositionAdjustPattern();\n\tthis.setupTimingPattern();\n\tthis.setupTypeInfo(test, maskPattern);\n\t\n\tif (this.typeNumber >= 7) {\n\t\tthis.setupTypeNumber(test);\n\t}\n\n\tif (this.dataCache == null) {\n\t\tthis.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);\n\t}\n\n\tthis.mapData(this.dataCache, maskPattern);\n};\n\nproto.setupPositionProbePattern = function(row, col) {\n\t\n\tfor (var r = -1; r <= 7; r++) {\n\t\t\n\t\tif (row + r <= -1 || this.moduleCount <= row + r) continue;\n\t\t\n\t\tfor (var c = -1; c <= 7; c++) {\n\t\t\t\n\t\t\tif (col + c <= -1 || this.moduleCount <= col + c) continue;\n\t\t\t\n\t\t\tif ( (0 <= r && r <= 6 && (c == 0 || c == 6) )\n\t\t\t\t\t|| (0 <= c && c <= 6 && (r == 0 || r == 6) )\n\t\t\t\t\t|| (2 <= r && r <= 4 && 2 <= c && c <= 4) ) {\n\t\t\t\tthis.modules[row + r][col + c] = true;\n\t\t\t} else {\n\t\t\t\tthis.modules[row + r][col + c] = false;\n\t\t\t}\n\t\t}\t\t\n\t}\t\t\n};\n\nproto.getBestMaskPattern = function() {\n\n\tvar minLostPoint = 0;\n\tvar pattern = 0;\n\n\tfor (var i = 0; i < 8; i++) {\n\t\t\n\t\tthis.makeImpl(true, i);\n\n\t\tvar lostPoint = util.getLostPoint(this);\n\n\t\tif (i == 0 || minLostPoint > lostPoint) {\n\t\t\tminLostPoint = lostPoint;\n\t\t\tpattern = i;\n\t\t}\n\t}\n\n\treturn pattern;\n};\n\nproto.createMovieClip = function(target_mc, instance_name, depth) {\n\n\tvar qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);\n\tvar cs = 1;\n\n\tthis.make();\n\n\tfor (var row = 0; row < this.modules.length; row++) {\n\t\t\n\t\tvar y = row * cs;\n\t\t\n\t\tfor (var col = 0; col < this.modules[row].length; col++) {\n\n\t\t\tvar x = col * cs;\n\t\t\tvar dark = this.modules[row][col];\n\t\t\n\t\t\tif (dark) {\n\t\t\t\tqr_mc.beginFill(0, 100);\n\t\t\t\tqr_mc.moveTo(x, y);\n\t\t\t\tqr_mc.lineTo(x + cs, y);\n\t\t\t\tqr_mc.lineTo(x + cs, y + cs);\n\t\t\t\tqr_mc.lineTo(x, y + cs);\n\t\t\t\tqr_mc.endFill();\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn qr_mc;\n};\n\nproto.setupTimingPattern = function() {\n\t\n\tfor (var r = 8; r < this.moduleCount - 8; r++) {\n\t\tif (this.modules[r][6] != null) {\n\t\t\tcontinue;\n\t\t}\n\t\tthis.modules[r][6] = (r % 2 == 0);\n\t}\n\n\tfor (var c = 8; c < this.moduleCount - 8; c++) {\n\t\tif (this.modules[6][c] != null) {\n\t\t\tcontinue;\n\t\t}\n\t\tthis.modules[6][c] = (c % 2 == 0);\n\t}\n};\n\nproto.setupPositionAdjustPattern = function() {\n\n\tvar pos = util.getPatternPosition(this.typeNumber);\n\t\n\tfor (var i = 0; i < pos.length; i++) {\n\t\n\t\tfor (var j = 0; j < pos.length; j++) {\n\t\t\n\t\t\tvar row = pos[i];\n\t\t\tvar col = pos[j];\n\t\t\t\n\t\t\tif (this.modules[row][col] != null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tfor (var r = -2; r <= 2; r++) {\n\t\t\t\n\t\t\t\tfor (var c = -2; c <= 2; c++) {\n\t\t\t\t\n\t\t\t\t\tif (r == -2 || r == 2 || c == -2 || c == 2\n\t\t\t\t\t\t\t|| (r == 0 && c == 0) ) {\n\t\t\t\t\t\tthis.modules[row + r][col + c] = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.modules[row + r][col + c] = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nproto.setupTypeNumber = function(test) {\n\n\tvar bits = util.getBCHTypeNumber(this.typeNumber);\n\n\tfor (var i = 0; i < 18; i++) {\n\t\tvar mod = (!test && ( (bits >> i) & 1) == 1);\n\t\tthis.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;\n\t}\n\n\tfor (var i = 0; i < 18; i++) {\n\t\tvar mod = (!test && ( (bits >> i) & 1) == 1);\n\t\tthis.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;\n\t}\n};\n\nproto.setupTypeInfo = function(test, maskPattern) {\n\n\tvar data = (this.errorCorrectLevel << 3) | maskPattern;\n\tvar bits = util.getBCHTypeInfo(data);\n\n\t// vertical\t\t\n\tfor (var i = 0; i < 15; i++) {\n\n\t\tvar mod = (!test && ( (bits >> i) & 1) == 1);\n\n\t\tif (i < 6) {\n\t\t\tthis.modules[i][8] = mod;\n\t\t} else if (i < 8) {\n\t\t\tthis.modules[i + 1][8] = mod;\n\t\t} else {\n\t\t\tthis.modules[this.moduleCount - 15 + i][8] = mod;\n\t\t}\n\t}\n\n\t// horizontal\n\tfor (var i = 0; i < 15; i++) {\n\n\t\tvar mod = (!test && ( (bits >> i) & 1) == 1);\n\t\t\n\t\tif (i < 8) {\n\t\t\tthis.modules[8][this.moduleCount - i - 1] = mod;\n\t\t} else if (i < 9) {\n\t\t\tthis.modules[8][15 - i - 1 + 1] = mod;\n\t\t} else {\n\t\t\tthis.modules[8][15 - i - 1] = mod;\n\t\t}\n\t}\n\n\t// fixed module\n\tthis.modules[this.moduleCount - 8][8] = (!test);\n};\n\nproto.mapData = function(data, maskPattern) {\n\t\n\tvar inc = -1;\n\tvar row = this.moduleCount - 1;\n\tvar bitIndex = 7;\n\tvar byteIndex = 0;\n\t\n\tfor (var col = this.moduleCount - 1; col > 0; col -= 2) {\n\n\t\tif (col == 6) col--;\n\n\t\twhile (true) {\n\n\t\t\tfor (var c = 0; c < 2; c++) {\n\t\t\t\t\n\t\t\t\tif (this.modules[row][col - c] == null) {\n\t\t\t\t\t\n\t\t\t\t\tvar dark = false;\n\n\t\t\t\t\tif (byteIndex < data.length) {\n\t\t\t\t\t\tdark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar mask = util.getMask(maskPattern, row, col - c);\n\n\t\t\t\t\tif (mask) {\n\t\t\t\t\t\tdark = !dark;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthis.modules[row][col - c] = dark;\n\t\t\t\t\tbitIndex--;\n\n\t\t\t\t\tif (bitIndex == -1) {\n\t\t\t\t\t\tbyteIndex++;\n\t\t\t\t\t\tbitIndex = 7;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\trow += inc;\n\n\t\t\tif (row < 0 || this.moduleCount <= row) {\n\t\t\t\trow -= inc;\n\t\t\t\tinc = -inc;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n};\n\nQRCode.PAD0 = 0xEC;\nQRCode.PAD1 = 0x11;\n\nQRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {\n\t\n\tvar rsBlocks = RSBlock.getRSBlocks(typeNumber, errorCorrectLevel);\n\t\n\tvar buffer = new BitBuffer();\n\t\n\tfor (var i = 0; i < dataList.length; i++) {\n\t\tvar data = dataList[i];\n\t\tbuffer.put(data.mode, 4);\n\t\tbuffer.put(data.getLength(), util.getLengthInBits(data.mode, typeNumber) );\n\t\tdata.write(buffer);\n\t}\n\n\t// calc num max data.\n\tvar totalDataCount = 0;\n\tfor (var i = 0; i < rsBlocks.length; i++) {\n\t\ttotalDataCount += rsBlocks[i].dataCount;\n\t}\n\n\tif (buffer.getLengthInBits() > totalDataCount * 8) {\n\t\tthrow new Error(\"code length overflow. (\"\n\t\t\t+ buffer.getLengthInBits()\n\t\t\t+ \">\"\n\t\t\t+ totalDataCount * 8\n\t\t\t+ \")\");\n\t}\n\n\t// end code\n\tif (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {\n\t\tbuffer.put(0, 4);\n\t}\n\n\t// padding\n\twhile (buffer.getLengthInBits() % 8 != 0) {\n\t\tbuffer.putBit(false);\n\t}\n\n\t// padding\n\twhile (true) {\n\t\t\n\t\tif (buffer.getLengthInBits() >= totalDataCount * 8) {\n\t\t\tbreak;\n\t\t}\n\t\tbuffer.put(QRCode.PAD0, 8);\n\t\t\n\t\tif (buffer.getLengthInBits() >= totalDataCount * 8) {\n\t\t\tbreak;\n\t\t}\n\t\tbuffer.put(QRCode.PAD1, 8);\n\t}\n\n\treturn QRCode.createBytes(buffer, rsBlocks);\n};\n\nQRCode.createBytes = function(buffer, rsBlocks) {\n\n\tvar offset = 0;\n\t\n\tvar maxDcCount = 0;\n\tvar maxEcCount = 0;\n\t\n\tvar dcdata = new Array(rsBlocks.length);\n\tvar ecdata = new Array(rsBlocks.length);\n\t\n\tfor (var r = 0; r < rsBlocks.length; r++) {\n\n\t\tvar dcCount = rsBlocks[r].dataCount;\n\t\tvar ecCount = rsBlocks[r].totalCount - dcCount;\n\n\t\tmaxDcCount = Math.max(maxDcCount, dcCount);\n\t\tmaxEcCount = Math.max(maxEcCount, ecCount);\n\t\t\n\t\tdcdata[r] = new Array(dcCount);\n\t\t\n\t\tfor (var i = 0; i < dcdata[r].length; i++) {\n\t\t\tdcdata[r][i] = 0xff & buffer.buffer[i + offset];\n\t\t}\n\t\toffset += dcCount;\n\t\t\n\t\tvar rsPoly = util.getErrorCorrectPolynomial(ecCount);\n\t\tvar rawPoly = new Polynomial(dcdata[r], rsPoly.getLength() - 1);\n\n\t\tvar modPoly = rawPoly.mod(rsPoly);\n\t\tecdata[r] = new Array(rsPoly.getLength() - 1);\n\t\tfor (var i = 0; i < ecdata[r].length; i++) {\n var modIndex = i + modPoly.getLength() - ecdata[r].length;\n\t\t\tecdata[r][i] = (modIndex >= 0)? modPoly.get(modIndex) : 0;\n\t\t}\n\n\t}\n\t\n\tvar totalCodeCount = 0;\n\tfor (var i = 0; i < rsBlocks.length; i++) {\n\t\ttotalCodeCount += rsBlocks[i].totalCount;\n\t}\n\n\tvar data = new Array(totalCodeCount);\n\tvar index = 0;\n\n\tfor (var i = 0; i < maxDcCount; i++) {\n\t\tfor (var r = 0; r < rsBlocks.length; r++) {\n\t\t\tif (i < dcdata[r].length) {\n\t\t\t\tdata[index++] = dcdata[r][i];\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (var i = 0; i < maxEcCount; i++) {\n\t\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