Socket
Socket
Sign inDemoInstall

qrcode

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qrcode - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

build/qrcode.min.js.map

3

build/qrcode.min.js

@@ -1,1 +0,2 @@

(function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var j=typeof require=="function"&&require;if(!h&&j)return j(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}var f=typeof require=="function"&&require;for(var g=0;g<d.length;g++)e(d[g]);return e})({1:[function(a,b,c){c.QRCapacityTable=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]},{}],2:[function(a,b,c){function h(){}var d=a("bops"),e=a("./qrcode.js"),f=a("./qrcapacitytable.js").QRCapacityTable,g=e.QRCode;c.QRCodeDraw=h,c.QRVersionCapacityTable=f,c.QRErrorCorrectLevel=e.QRErrorCorrectLevel,c.QRCode=e.QRCode,h.prototype={scale:4,defaultMargin:20,marginScaleFactor:5,Array:typeof Uint32Array=="undefined"?Uint32Array:Array,errorBehavior:{length:"trim"},color:{dark:"black",light:"white"},defaultErrorCorrectLevel:e.QRErrorCorrectLevel.H,QRErrorCorrectLevel:e.QRErrorCorrectLevel,draw:function(a,b,c,d){var f,g,h,i=Array.prototype.slice.call(arguments);d=i.pop(),a=i.shift(),b=i.shift(),c=i.shift()||{};if(typeof d!="function")throw new Error("callback required");typeof c!="object"&&(c.errorCorrectLevel=c),this.QRVersion(b,c.errorCorrectLevel||this.QRErrorCorrectLevel.H,c.version,function(a,c,d,e){b=c,f=d,g=a,h=e}),this.scale=c.scale||this.scale,this.margin=typeof c.margin=="undefined"?this.defaultMargin:c.margin;if(!f){d(g,a);return}try{var j=new e.QRCode(f,h),k=this.scale||4,l=a.getContext("2d"),m=0;j.addData(b),j.make();var n=this.marginWidth(),o=n;m=this.dataWidth(j)+n*2,this.resetCanvas(a,l,m);for(var p=0,q=j.getModuleCount();p<q;p++){var r=n;for(var s=0,t=j.getModuleCount();s<t;s++)j.isDark(p,s)?(l.fillStyle=this.color.dark,l.fillRect(r,o,k,k)):this.color.light&&(l.fillStyle=this.color.light,l.fillRect(r,o,k,k)),r+=k;o+=k}}catch(u){g=u}d(g,a,m)},drawBitArray:function(a){var b=Array.prototype.slice.call(arguments),c=b.pop(),a=b.shift(),d=b.shift()||{};if(typeof c!="function")throw new Error("callback required as last argument");this.QRVersion(a,d.errorCorrectLevel,d.version,function(b,c,d,e){a=c,level=d,error=b,errorCorrectLevel=e});if(!level){c(error,[],0);return}try{var f=new e.QRCode(level,errorCorrectLevel),g=this.scale||4,h=0,i,j=0,k=0;f.addData(a),f.make(),h=this.dataWidth(f,1),i=new this.Array(h*h);for(var l=0,m=f.getModuleCount();l<m;l++)for(var n=0,o=f.getModuleCount();n<o;n++)f.isDark(l,n)?i[j]=1:i[j]=0,j++}catch(p){error=p,console.log(p.stack)}c(error,i,h)},QRVersion:function(a,b,c,e){var g=d.from(a).length,h,b=this.QRErrorCorrectLevel[b];b===undefined&&(b=this.defaultErrorCorrectLevel);var i=[1,0,3,2],j=["L","M","Q","H"],k=0,l=!1;typeof c!="undefined"&&c!==null&&(l=!0);if(l)k=f[c][i[b]];else{for(var m=0,n=f.length;m<n;m++){k=f[m][i[b]];if(g<f[m][i[b]]){c=m+1;break}}c||(c=f.length-1)}return k<g&&(this.errorBehavior.length=="trim"?(a=a.substr(0,k),level=f.length):h=new Error("input string too long for error correction "+j[i[b]]+" max length "+k+" for qrcode version "+c)),e&&e(h,a,c,b),c},marginWidth:function(){var a=this.margin;return this.scale=this.scale||4,this.scale*this.marginScaleFactor>a&&a>0&&(a=this.scale*this.marginScaleFactor),a},dataWidth:function(a,b){return a.getModuleCount()*(b||this.scale||4)},resetCanvas:function(a,b,c){b.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.style.height=a.height=c,a.style.width=a.width=c,this.color.light?(b.fillStyle=this.color.light,b.fillRect(0,0,a.width,a.height)):b.clearRect(0,0,a.width,a.height)}}},{"./qrcapacitytable.js":1,"./qrcode.js":3,bops:4}],3:[function(a,b,c){function f(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=new e}function g(a){this.mode=h.MODE_8BIT_BYTE,this.data=a;var b=[];this.parsedData=d.from(a)}function n(a,b){if(a.length==undefined)throw new Error(a.length+"/"+b);var c=0;while(c<a.length&&a[c]==0)c++;this.num=new Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}function o(a,b){this.totalCount=a,this.dataCount=b}function p(){this.buffer=new Array,this.length=0}var d=a("bops");c.QRCode=f;var e=typeof Uint32Array=="undefined"?Uint32Array:Array;f.prototype={addData:function(a){var b=new g(a);this.dataList.push(b),this.dataCache=null},isDark:function(a,b){if(a<0||this.moduleCount<=a||b<0||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,b){this.moduleCount=this.typeNumber*4+17,this.modules=new e(this.moduleCount);for(var c=0;c<this.moduleCount;c++){this.modules[c]=new e(this.moduleCount);for(var d=0;d<this.moduleCount;d++)this.modules[c][d]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,b),this.typeNumber>=7&&this.setupTypeNumber(a),this.dataCache==null&&(this.dataCache=f.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,b)},setupPositionProbePattern:function(a,b){for(var c=-1;c<=7;c++){if(a+c<=-1||this.moduleCount<=a+c)continue;for(var d=-1;d<=7;d++){if(b+d<=-1||this.moduleCount<=b+d)continue;0<=c&&c<=6&&(d==0||d==6)||0<=d&&d<=6&&(c==0||c==6)||2<=c&&c<=4&&2<=d&&d<=4?this.modules[a+c][b+d]=!0:this.modules[a+c][b+d]=!1}}},getBestMaskPattern:function(){var a=0,b=0;for(var c=0;c<8;c++){this.makeImpl(!0,c);var d=k.getLostPoint(this);if(c==0||a>d)a=d,b=c}return b},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++){if(this.modules[a][6]!=null)continue;this.modules[a][6]=a%2==0}for(var b=8;b<this.moduleCount-8;b++){if(this.modules[6][b]!=null)continue;this.modules[6][b]=b%2==0}},setupPositionAdjustPattern:function(){var a=k.getPatternPosition(this.typeNumber);a=a||"";for(var b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(this.modules[d][e]!=null)continue;for(var f=-2;f<=2;f++)for(var g=-2;g<=2;g++)f==-2||f==2||g==-2||g==2||f==0&&g==0?this.modules[d+f][e+g]=!0:this.modules[d+f][e+g]=!1}},setupTypeNumber:function(a){var b=k.getBCHTypeNumber(this.typeNumber);for(var c=0;c<18;c++){var d=!a&&(b>>c&1)==1;this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;c<18;c++){var d=!a&&(b>>c&1)==1;this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){var c=this.errorCorrectLevel<<3|b,d=k.getBCHTypeInfo(c);for(var e=0;e<15;e++){var f=!a&&(d>>e&1)==1;e<6?this.modules[e][8]=f:e<8?this.modules[e+1][8]=f:this.modules[this.moduleCount-15+e][8]=f}for(var e=0;e<15;e++){var f=!a&&(d>>e&1)==1;e<8?this.modules[8][this.moduleCount-e-1]=f:e<9?this.modules[8][15-e-1+1]=f:this.modules[8][15-e-1]=f}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){var c=-1,d=this.moduleCount-1,e=7,f=0;for(var g=this.moduleCount-1;g>0;g-=2){g==6&&g--;for(;;){for(var h=0;h<2;h++)if(this.modules[d][g-h]==null){var i=!1;f<a.length&&(i=(a[f]>>>e&1)==1);var j=k.getMask(b,d,g-h);j&&(i=!i),this.modules[d][g-h]=i,e--,e==-1&&(f++,e=7)}d+=c;if(d<0||this.moduleCount<=d){d-=c,c=-c;break}}}}},f.PAD0=236,f.PAD1=17,f.createData=function(a,b,c){var d=o.getRSBlocks(a,b),e=new p;for(var g=0;g<c.length;g++){var h=c[g];e.put(h.mode,4),e.put(h.getLength(),k.getLengthInBits(h.mode,a)),h.write(e)}var i=0;for(var g=0;g<d.length;g++)i+=d[g].dataCount;if(e.getLengthInBits()>i*8)throw new Error("code length overflow. ("+e.getLengthInBits()+">"+i*8+")");e.getLengthInBits()+4<=i*8&&e.put(0,4);while(e.getLengthInBits()%8!=0)e.putBit(!1);for(;;){if(e.getLengthInBits()>=i*8)break;e.put(f.PAD0,8);if(e.getLengthInBits()>=i*8)break;e.put(f.PAD1,8)}return f.createBytes(e,d)},f.createBytes=function(a,b){var c=0,d=0,f=0,g=new e(b.length),h=new e(b.length);for(var i=0;i<b.length;i++){var j=b[i].dataCount,l=b[i].totalCount-j;d=Math.max(d,j),f=Math.max(f,l),g[i]=new e(j);for(var m=0;m<g[i].length;m++)g[i][m]=255&a.buffer[m+c];c+=j;var o=k.getErrorCorrectPolynomial(l),p=new n(g[i],o.getLength()-1),q=p.mod(o);h[i]=new e(o.getLength()-1);for(var m=0;m<h[i].length;m++){var r=m+q.getLength()-h[i].length;h[i][m]=r>=0?q.get(r):0}}var s=0;for(var m=0;m<b.length;m++)s+=b[m].totalCount;var t=new e(s),u=0;for(var m=0;m<d;m++)for(var i=0;i<b.length;i++)m<g[i].length&&(t[u++]=g[i][m]);for(var m=0;m<f;m++)for(var i=0;i<b.length;i++)m<h[i].length&&(t[u++]=h[i][m]);return t},g.prototype={getLength:function(a){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;b<c;b++)a.put(this.parsedData[b],8)}};var h={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},i=c.QRErrorCorrectLevel={L:1,M:0,Q:3,H:2},j={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},k={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){var b=a<<10;while(k.getBCHDigit(b)-k.getBCHDigit(k.G15)>=0)b^=k.G15<<k.getBCHDigit(b)-k.getBCHDigit(k.G15);return(a<<10|b)^k.G15_MASK},getBCHTypeNumber:function(a){var b=a<<12;while(k.getBCHDigit(b)-k.getBCHDigit(k.G18)>=0)b^=k.G18<<k.getBCHDigit(b)-k.getBCHDigit(k.G18);return a<<12|b},getBCHDigit:function(a){var b=0;while(a!=0)b++,a>>>=1;return b},getPatternPosition:function(a){return k.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case j.PATTERN000:return(b+c)%2==0;case j.PATTERN001:return b%2==0;case j.PATTERN010:return c%3==0;case j.PATTERN011:return(b+c)%3==0;case j.PATTERN100:return(Math.floor(b/2)+Math.floor(c/3))%2==0;case j.PATTERN101:return b*c%2+b*c%3==0;case j.PATTERN110:return(b*c%2+b*c%3)%2==0;case j.PATTERN111:return(b*c%3+(b+c)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){var b=new n([1],0);for(var c=0;c<a;c++)b=b.multiply(new n([1,l.gexp(c)],0));return b},getLengthInBits:function(a,b){if(1<=b&&b<10)switch(a){case h.MODE_NUMBER:return 10;case h.MODE_ALPHA_NUM:return 9;case h.MODE_8BIT_BYTE:return 8;case h.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(b<27)switch(a){case h.MODE_NUMBER:return 12;case h.MODE_ALPHA_NUM:return 11;case h.MODE_8BIT_BYTE:return 16;case h.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(b<41))throw new Error("type:"+b);switch(a){case h.MODE_NUMBER:return 14;case h.MODE_ALPHA_NUM:return 13;case h.MODE_8BIT_BYTE:return 16;case h.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){var b=a.getModuleCount(),c=0;for(var d=0;d<b;d++)for(var e=0;e<b;e++){var f=0,g=a.isDark(d,e);for(var h=-1;h<=1;h++){if(d+h<0||b<=d+h)continue;for(var i=-1;i<=1;i++){if(e+i<0||b<=e+i)continue;if(h==0&&i==0)continue;g==a.isDark(d+h,e+i)&&f++}}f>5&&(c+=3+f-5)}for(var d=0;d<b-1;d++)for(var e=0;e<b-1;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++;if(j==0||j==4)c+=3}for(var d=0;d<b;d++)for(var e=0;e<b-6;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;e<b;e++)for(var d=0;d<b-6;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);var k=0;for(var e=0;e<b;e++)for(var d=0;d<b;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=l*10,c}},l={glog:function(a){if(a<1)throw new Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){while(a<0)a+=255;while(a>=256)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var m=0;m<8;m++)l.EXP_TABLE[m]=1<<m;for(var m=8;m<256;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(var m=0;m<255;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;n.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){var b=new Array(this.getLength()+a.getLength()-1);for(var c=0;c<this.getLength();c++)for(var d=0;d<a.getLength();d++)b[c+d]^=l.gexp(l.glog(this.get(c))+l.glog(a.get(d)));return new n(b,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;var b=l.glog(this.get(0))-l.glog(a.get(0)),c=new Array(this.getLength());for(var d=0;d<this.getLength();d++)c[d]=this.get(d);for(var d=0;d<a.getLength();d++)c[d]^=l.gexp(l.glog(a.get(d))+b);return(new n(c,0)).mod(a)}},o.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],o.getRSBlocks=function(a,b){var c=o.getRsBlockTable(a,b);if(c==undefined)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+b);var d=c.length/3,e=new Array;for(var f=0;f<d;f++){var g=c[f*3+0],h=c[f*3+1],i=c[f*3+2];for(var j=0;j<g;j++)e.push(new o(h,i))}return e},o.getRsBlockTable=function(a,b){switch(b){case i.L:return o.RS_BLOCK_TABLE[(a-1)*4+0];case i.M:return o.RS_BLOCK_TABLE[(a-1)*4+1];case i.Q:return o.RS_BLOCK_TABLE[(a-1)*4+2];case i.H:return o.RS_BLOCK_TABLE[(a-1)*4+3];default:return undefined}},p.prototype={get:function(a){var b=Math.floor(a/8);return(this.buffer[b]>>>7-a%8&1)==1},put:function(a,b){for(var c=0;c<b;c++)this.putBit((a>>>b-c-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer[b]|=128>>>this.length%8),this.length++}}},{bops:4}],4:[function(a,b,c){function e(a,b){for(var c in a)b[c]=a[c]}var d={};b.exports=d,d.from=a("./from.js"),d.to=a("./to.js"),d.is=a("./is.js"),d.subarray=a("./subarray.js"),d.join=a("./join.js"),d.copy=a("./copy.js"),d.create=a("./create.js"),e(a("./read.js"),d),e(a("./write.js"),d)},{"./copy.js":7,"./create.js":8,"./from.js":9,"./is.js":10,"./join.js":11,"./read.js":13,"./subarray.js":14,"./to.js":15,"./write.js":16}],5:[function(a,b,c){(function(a){function d(a){var b,d,e,f,g,h;if(a.length%4>0)throw"Invalid string. Length must be a multiple of 4";g=a.indexOf("="),g=g>0?a.length-g:0,h=[],e=g>0?a.length-4:a.length;for(b=0,d=0;b<e;b+=4,d+=3)f=c.indexOf(a[b])<<18|c.indexOf(a[b+1])<<12|c.indexOf(a[b+2])<<6|c.indexOf(a[b+3]),h.push((f&16711680)>>16),h.push((f&65280)>>8),h.push(f&255);return g===2?(f=c.indexOf(a[b])<<2|c.indexOf(a[b+1])>>4,h.push(f&255)):g===1&&(f=c.indexOf(a[b])<<10|c.indexOf(a[b+1])<<4|c.indexOf(a[b+2])>>2,h.push(f>>8&255),h.push(f&255)),h}function e(a){function h(a){return c[a>>18&63]+c[a>>12&63]+c[a>>6&63]+c[a&63]}var b,d=a.length%3,e="",f,g;for(b=0,g=a.length-d;b<g;b+=3)f=(a[b]<<16)+(a[b+1]<<8)+a[b+2],e+=h(f);switch(d){case 1:f=a[a.length-1],e+=c[f>>2],e+=c[f<<4&63],e+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],e+=c[f>>10],e+=c[f>>4&63],e+=c[f<<2&63],e+="="}return e}"use strict";var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";b.exports.toByteArray=d,b.exports.fromByteArray=e})()},{}],6:[function(a,b,c){function i(a,b,c){b=b===undefined?0:b,c=c===undefined?a.length:c;var g=0,i=128,l=0,m,n;e.length=d.length=0;while(g<a.length)n=a[g],!l&&n&i?(m=j(n),l+=m,m<8&&(e[e.length]=n&h[6-m])):l?(e[e.length]=n&h[6],--l,!l&&e.length&&(d[d.length]=f(k(e,m)),e.length=0)):d[d.length]=f(n),++g;return e.length&&!l&&(d[d.length]=f(k(e,m)),e.length=0),d.join("")}function j(a){for(var b=0;b<7;++b)if(!(a&g[b]))break;return b}function k(a){var b=0;for(var c=0,d=a.length;c<d;++c)b|=a[c]<<(d-c-1)*6;return b}b.exports=i;var d=[],e=[],f=String.fromCharCode,g=[64,32,16,8,4,2,1],h=[0,1,3,7,15,31,63,127]},{}],7:[function(a,b,c){function e(a,b,c,d,e){c=arguments.length<3?0:c,d=arguments.length<4?0:d,e=arguments.length<5?a.length:e;if(e===d)return;if(b.length===0||a.length===0)return;return e>a.length&&(e=a.length),b.length-c<e-d&&(e=b.length-c+start),a.buffer!==b.buffer?f(a,b,c,d,e):g(a,b,c,d,e)}function f(a,b,c,d,e){var f=e-d+c;for(var g=c,h=d;g<f;++g,++h)b[g]=a[h]}function g(a,b,c,e,f){var g=f+e,h=new Uint8Array(d.call(a,e,g)),i=0;for(;e<g;++e,++i)b[c++]=h[i]}b.exports=e;var d=[].slice},{}],8:[function(a,b,c){b.exports=function(a){return new Uint8Array(a)}},{}],9:[function(a,b,c){function f(a,b){return Array.isArray(a)?new Uint8Array(a):e[b||"utf8"](a)}function g(a){var b=a.length/2,c=new Uint8Array(b),d="";for(var e=0,f=a.length;e<f;++e)d+=a.charAt(e),e>0&&e%2===1&&(c[e>>>1]=parseInt(d,16),d="");return c}function h(a){var b=[],c,d;for(var e=0,f=a.length;e<f;++e){d=a.charCodeAt(e);if(d&128){c=encodeURIComponent(a.charAt(e)).substr(1).split("%");for(var g=0,h=c.length;g<h;++g)b[b.length]=parseInt(c[g],16)}else b[b.length]=d}return new Uint8Array(b)}function i(a){return new Uint8Array(d.toByteArray(a))}b.exports=f;var d=a("base64-js"),e={hex:g,utf8:h,base64:i}},{"base64-js":5}],10:[function(a,b,c){b.exports=function(a){return a instanceof Uint8Array}},{}],11:[function(a,b,c){function d(a,b){if(!a.length)return new Uint8Array(0);var c=b!==undefined?b:e(a),d=new Uint8Array(c),f=a[0],g=f.length,h=0,i=0,j=0;while(j<c){if(i===g){i=0,++h,f=a[h],g=f&&f.length;continue}d[j++]=f[i++]}return d}function e(a){var b=0;for(var c=0,d=a.length;c<d;++c)b+=a[c].byteLength;return b}b.exports=d},{}],12:[function(a,b,c){function f(a){return new DataView(a.buffer,0)}function g(a){var b=e.get(a.buffer);return b||e.set(a.buffer,b=new DataView(a.buffer,0)),b}var d,e;b.exports=d={},e=typeof WeakMap=="undefined"?null:new WeakMap,d.get=e?g:f},{}],13:[function(a,b,c){function e(a,b){return a[b]}function f(a,b){var c=a[b];return c<128?c:c-256}function g(a,b){var c=d.get(a);return c.getUint16(b+a.byteOffset,!0)}function h(a,b){var c=d.get(a);return c.getUint32(b+a.byteOffset,!0)}function i(a,b){var c=d.get(a);return c.getInt16(b+a.byteOffset,!0)}function j(a,b){var c=d.get(a);return c.getInt32(b+a.byteOffset,!0)}function k(a,b){var c=d.get(a);return c.getFloat32(b+a.byteOffset,!0)}function l(a,b){var c=d.get(a);return c.getFloat64(b+a.byteOffset,!0)}function m(a,b){var c=d.get(a);return c.getUint16(b+a.byteOffset,!1)}function n(a,b){var c=d.get(a);return c.getUint32(b+a.byteOffset,!1)}function o(a,b){var c=d.get(a);return c.getInt16(b+a.byteOffset,!1)}function p(a,b){var c=d.get(a);return c.getInt32(b+a.byteOffset,!1)}function q(a,b){var c=d.get(a);return c.getFloat32(b+a.byteOffset,!1)}function r(a,b){var c=d.get(a);return c.getFloat64(b+a.byteOffset,!1)}b.exports={readUInt8:e,readInt8:f,readUInt16LE:g,readUInt32LE:h,readInt16LE:i,readInt32LE:j,readFloatLE:k,readDoubleLE:l,readUInt16BE:m,readUInt32BE:n,readInt16BE:o,readInt32BE:p,readFloatBE:q,readDoubleBE:r};var d=a("./mapped.js")},{"./mapped.js":12}],14:[function(a,b,c){function d(a,b,c){return a.subarray(b||0,c||a.length)}b.exports=d},{}],15:[function(a,b,c){function g(a,b){return f[b||"utf8"](a)}function h(a){var b="",c;for(var d=0,e=a.length;d<e;++d)c=a[d],b+=((c&240)>>>4).toString(16),b+=(c&15).toString(16);return b}function i(a){return e(a)}function j(a){return d.fromByteArray(a)}b.exports=g;var d=a("base64-js"),e=a("to-utf8"),f={hex:h,utf8:i,base64:j}},{"base64-js":5,"to-utf8":6}],16:[function(a,b,c){function e(a,b,c){return a[c]=b}function f(a,b,c){return a[c]=b<0?b+256:b}function g(a,b,c){var e=d.get(a);return e.setUint16(c+a.byteOffset,b,!0)}function h(a,b,c){var e=d.get(a);return e.setUint32(c+a.byteOffset,b,!0)}function i(a,b,c){var e=d.get(a);return e.setInt16(c+a.byteOffset,b,!0)}function j(a,b,c){var e=d.get(a);return e.setInt32(c+a.byteOffset,b,!0)}function k(a,b,c){var e=d.get(a);return e.setFloat32(c+a.byteOffset,b,!0)}function l(a,b,c){var e=d.get(a);return e.setFloat64(c+a.byteOffset,b,!0)}function m(a,b,c){var e=d.get(a);return e.setUint16(c+a.byteOffset,b,!1)}function n(a,b,c){var e=d.get(a);return e.setUint32(c+a.byteOffset,b,!1)}function o(a,b,c){var e=d.get(a);return e.setInt16(c+a.byteOffset,b,!1)}function p(a,b,c){var e=d.get(a);return e.setInt32(c+a.byteOffset,b,!1)}function q(a,b,c){var e=d.get(a);return e.setFloat32(c+a.byteOffset,b,!1)}function r(a,b,c){var e=d.get(a);return e.setFloat64(c+a.byteOffset,b,!1)}b.exports={writeUInt8:e,writeInt8:f,writeUInt16LE:g,writeUInt32LE:h,writeInt16LE:i,writeInt32LE:j,writeFloatLE:k,writeDoubleLE:l,writeUInt16BE:m,writeUInt32BE:n,writeInt16BE:o,writeInt32BE:p,writeFloatBE:q,writeDoubleBE:r};var d=a("./mapped.js")},{"./mapped.js":12}],17:[function(a,b,c){var d=a("./lib/qrcode-draw.js");typeof window!="undefined"&&(window.qrcodelib=window.QRCodeLib=d,d.qrcodedraw=d.QRCodeDraw)},{"./lib/qrcode-draw.js":2}]},{},[17]);
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.qrcodelib=t()}}(function(){return function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){var f="function"==typeof require&&require;if(!a&&f)return f(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e,r){var n=t("./utils").getSymbolSize;r.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,r=n(t),o=145===r?26:2*Math.ceil((r-13)/(2*e-2)),i=[r-7],s=1;s<e-1;s++)i[s]=i[s-1]-o;return i.push(6),i.reverse()},r.getPositions=function(t){for(var e=[],n=r.getRowColCoords(t),o=n.length,i=0;i<o;i++)for(var s=0;s<o;s++)0===i&&0===s||0===i&&s===o-1||i===o-1&&0===s||e.push([n[i],n[s]]);return e}},{"./utils":15}],2:[function(t,e,r){function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1===(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1===(t>>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},e.exports=n},{}],3:[function(t,e,r){function n(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new o(t*t),this.data.fill(0),this.reservedBit=new o(t*t),this.reservedBit.fill(0)}var o=t("../utils/buffer");n.prototype.set=function(t,e,r,n){var o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)},n.prototype.get=function(t,e){return this.data[t*this.size+e]},n.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},n.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=n},{"../utils/buffer":20}],4:[function(t,e,r){function n(t){this.mode=i.BYTE,this.data=new o(t)}var o=t("../utils/buffer"),i=t("./mode");n.getCharCountIndicator=function(t){if(t>=1&&t<10)return 8;if(t>=10&&t<41)return 16;throw new Error("version: "+t)},n.prototype={getLength:function(t){return this.data.length},append:function(t){return this.data=o.concat([this.data,new o(t)]),this},write:function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)},getCharCountIndicator:n.getCharCountIndicator},e.exports=n},{"../utils/buffer":20,"./mode":11}],5:[function(t,e,r){var n=t("./error-correction-level"),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];r.getBlocksCount=function(t,e){switch(e){case n.L:return o[4*(t-1)+0];case n.M:return o[4*(t-1)+1];case n.Q:return o[4*(t-1)+2];case n.H:return o[4*(t-1)+3];default:return}},r.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return i[4*(t-1)+0];case n.M:return i[4*(t-1)+1];case n.Q:return i[4*(t-1)+2];case n.H:return i[4*(t-1)+3];default:return}}},{"./error-correction-level":6}],6:[function(t,e,r){e.exports={L:1,M:0,Q:3,H:2}},{}],7:[function(t,e,r){var n=t("./utils").getSymbolSize,o=7;r.getPositions=function(t){var e=n(t);return[[0,0],[e-o,0],[0,e-o]]}},{"./utils":15}],8:[function(t,e,r){var n=t("./utils"),o=1335,i=21522,s=n.getBCHDigit(o);r.getEncodedBits=function(t,e){for(var r=t<<3|e,a=r<<10;n.getBCHDigit(a)-s>=0;)a^=o<<n.getBCHDigit(a)-s;return(r<<10|a)^i}},{"./utils":15}],9:[function(t,e,r){var n=t("../utils/buffer"),o=new n(512),i=new n(256);!function(){for(var t=1,e=0;e<255;e++)o[e]=t,i[t]=e,t<<=1,256&t&&(t^=285);for(e=255;e<512;e++)o[e]=o[e-255]}(),r.log=function(t){if(t<1)throw new Error("log("+t+")");return i[t]},r.exp=function(t){return o[t]},r.mul=function(t,e){return 0===t||0===e?0:o[i[t]+i[e]]}},{"../utils/buffer":20}],10:[function(t,e,r){function n(t){for(var e=t.size,r=0,n=0;n<e;n++)for(var o=0;o<e;o++){for(var i=0,s=t.get(n,o),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var u=-1;u<=1;u++)o+u<0||e<=o+u||0===a&&0===u||s===t.get(n+a,o+u)&&i++;i>5&&(r+=f.N1+i-5)}return r}function o(t){for(var e=t.size,r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var i=0;t.get(n,o)&&i++,t.get(n+1,o)&&i++,t.get(n,o+1)&&i++,t.get(n+1,o+1)&&i++,0!==i&&4!==i||(r+=f.N2)}return r}function i(t){var e,r,n=t.size,o=0;for(e=0;e<n;e++)for(r=0;r<n-6;r++)t.get(e,r)&&!t.get(e,r+1)&&t.get(e,r+2)&&t.get(e,r+3)&&t.get(e,r+4)&&!t.get(e,r+5)&&t.get(e,r+6)&&(o+=f.N3);for(r=0;r<n;r++)for(e=0;e<n-6;e++)t.get(e,r)&&!t.get(e+1,r)&&t.get(e+2,r)&&t.get(e+3,r)&&t.get(e+4,r)&&!t.get(e+5,r)&&t.get(e+6,r)&&(o+=f.N3);return o}function s(t){for(var e=0,r=t.size,n=0;n<r;n++)for(var o=0;o<r;o++)t.get(o,n)&&e++;var i=Math.abs(100*e/r/r-50)/5;return i*f.N4}function a(t,e,n){switch(t){case r.Patterns.PATTERN000:return(e+n)%2===0;case r.Patterns.PATTERN001:return e%2===0;case r.Patterns.PATTERN010:return n%3===0;case r.Patterns.PATTERN011:return(e+n)%3===0;case r.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2===0;case r.Patterns.PATTERN101:return e*n%2+e*n%3===0;case r.Patterns.PATTERN110:return(e*n%2+e*n%3)%2===0;case r.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var f={N1:3,N2:3,N3:40,N4:10};r.applyMask=function(t,e){for(var r=e.size,n=0;n<r;n++)for(var o=0;o<r;o++)e.isReserved(o,n)||e.xor(o,n,a(t,o,n))},r.getBestMask=function(t){for(var e=Object.keys(r.Patterns).length,a=0,f=1/0,u=0;u<e;u++){r.applyMask(u,t);var l=n(t)+o(t)+i(t)+s(t);r.applyMask(u,t),l<f&&(f=l,a=u)}return a}},{}],11:[function(t,e,r){e.exports={NUMERIC:1,ALPHA_NUM:2,BYTE:4,KANJI:8}},{}],12:[function(t,e,r){var n=t("../utils/buffer"),o=t("./galois-field");r.mul=function(t,e){var r=new n(t.length+e.length-1);r.fill(0);for(var i=0;i<t.length;i++)for(var s=0;s<e.length;s++)r[i+s]^=o.mul(t[i],e[s]);return r},r.mod=function(t,e){for(var r=new n(t);r.length-e.length>=0;){for(var i=r[0],s=0;s<e.length;s++)r[s]^=o.mul(e[s],i);for(var a=0;a<r.length&&0===r[a];)a++;r=r.slice(a)}return r},r.generateECPolynomial=function(t){for(var e=new n([1]),i=0;i<t;i++)e=r.mul(e,[1,o.exp(i)]);return e}},{"../utils/buffer":20,"./galois-field":9}],13:[function(t,e,r){function n(t,e){for(var r=t.size,n=m.getPositions(e),o=0;o<n.length;o++)for(var i=n[o][0],s=n[o][1],a=-1;a<=7;a++)if(!(i+a<=-1||r<=i+a))for(var f=-1;f<=7;f++)s+f<=-1||r<=s+f||(a>=0&&a<=6&&(0===f||6===f)||f>=0&&f<=6&&(0===a||6===a)||a>=2&&a<=4&&f>=2&&f<=4?t.set(i+a,s+f,!0,!0):t.set(i+a,s+f,!1,!0))}function o(t){for(var e=t.size,r=8;r<e-8;r++){var n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function i(t,e){for(var r=w.getPositions(e),n=0;n<r.length;n++)for(var o=r[n][0],i=r[n][1],s=-2;s<=2;s++)for(var a=-2;a<=2;a++)s===-2||2===s||a===-2||2===a||0===s&&0===a?t.set(o+s,i+a,!0,!0):t.set(o+s,i+a,!1,!0)}function s(t,e,r){for(var n,o,i,s=t.size,a=B.getEncodedBits(e),f=0;f<18;f++)n=Math.floor(f/3),o=f%3+s-8-3,i=!r&&1===(a>>f&1),t.set(n,o,i,!0),t.set(o,n,i,!0)}function a(t,e,r,n){var o,i,s=t.size,a=A.getEncodedBits(e,r);for(o=0;o<15;o++)i=!n&&1===(a>>o&1),o<6?t.set(o,8,i,!0):o<8?t.set(o+1,8,i,!0):t.set(s-15+o,8,i,!0),o<8?t.set(8,s-o-1,i,!0):o<9?t.set(8,15-o-1+1,i,!0):t.set(8,15-o-1,i,!0);t.set(s-8,8,!n,!0)}function f(t,e){for(var r=t.size,n=-1,o=r-1,i=7,s=0,a=r-1;a>0;a-=2)for(6===a&&a--;;){for(var f=0;f<2;f++)if(!t.isReserved(o,a-f)){var u=!1;s<e.length&&(u=1===(e[s]>>>i&1)),t.set(o,a-f,u),i--,i===-1&&(s++,i=7)}if(o+=n,o<0||r<=o){o-=n,n=-n;break}}}function u(t,e,r){var n=new p;n.put(r.mode,4),n.put(r.getLength(),r.getCharCountIndicator(t)),r.write(n);var o=d.getSymbolTotalCodewords(t),i=C.getTotalCodewordsCount(t,e),s=8*(o-i);for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);for(var a=(s-n.getLengthInBits())/8,f=0;f<a;f++)n.put(f%2?17:236,8);return l(n,t,e)}function l(t,e,r){for(var n=d.getSymbolTotalCodewords(e),o=C.getTotalCodewordsCount(e,r),i=n-o,s=C.getBlocksCount(e,r),a=n%s,f=s-a,u=Math.floor(n/s),l=Math.floor(i/s),h=l+1,g=u-l,v=new E(g),p=0,y=new Array(s),w=new Array(s),m=0,b=new c(t.buffer),B=0;B<s;B++){var A=B<f?l:h;y[B]=b.slice(p,p+A),w[B]=v.encode(y[B]),p+=A,m=Math.max(m,A)}var T,R,P=new c(n),M=0;for(T=0;T<m;T++)for(R=0;R<s;R++)T<y[R].length&&(P[M++]=y[R][T]);for(T=0;T<g;T++)for(R=0;R<s;R++)T<w[R].length&&(P[M++]=w[R][T]);return P}function h(t,e){this.version=t,this.errorCorrectionLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.data=null}var c=t("../utils/buffer"),d=t("./utils"),g=t("./error-correction-level"),v=t("./byte-data"),p=t("./bit-buffer"),y=t("./bit-matrix"),w=t("./alignment-pattern"),m=t("./finder-pattern"),b=t("./mask-pattern"),C=t("./error-correction-code"),E=t("./reed-solomon-encoder"),B=t("./version"),A=t("./format-info");e.exports=h,h.prototype.addData=function(t){this.data?this.data.append(t):this.data=new v(t),this.dataCache=null},h.prototype.isDark=function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules.get(t,e)},h.prototype.getModuleCount=function(){return this.moduleCount},h.prototype.make=function(){if(null===this.dataCache){"undefined"==typeof this.errorCorrectionLevel&&(this.errorCorrectionLevel=g.H);var t=B.getBestVersionForData(this.data,this.errorCorrectionLevel);if(!t)throw new Error("The amount of data is too big to be stored in a QR Code");if(this.version){if(this.version<t)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMax characters allowed with current config: "+B.getCapacity(this.version,this.errorCorrectionLevel)+"\nMinimum version required to store current data: "+t+"\n")}else this.version=t;this.dataCache=u(this.version,this.errorCorrectionLevel,this.data)}this.moduleCount=d.getSymbolSize(this.version),this.modules=new y(this.moduleCount),n(this.modules,this.version),o(this.modules),i(this.modules,this.version),a(this.modules,this.errorCorrectionLevel,0,!0),this.version>=7&&s(this.modules,this.version,!0),f(this.modules,this.dataCache);var e=b.getBestMask(this.modules);b.applyMask(e,this.modules),a(this.modules,this.errorCorrectionLevel,e),this.version>=7&&s(this.modules,this.version)}},{"../utils/buffer":20,"./alignment-pattern":1,"./bit-buffer":2,"./bit-matrix":3,"./byte-data":4,"./error-correction-code":5,"./error-correction-level":6,"./finder-pattern":7,"./format-info":8,"./mask-pattern":10,"./reed-solomon-encoder":14,"./utils":15,"./version":16}],14:[function(t,e,r){function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}var o=t("../utils/buffer"),i=t("./polynomial");n.prototype.initialize=function(t){this.degree=t,this.genPoly=i.generateECPolynomial(this.degree)},n.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new o(this.degree);e.fill(0);var r=o.concat([t,e],t.length+this.degree),n=i.mod(r,this.genPoly),s=this.degree-n.length;if(s>0){var a=new o(this.degree);return a.fill(0),n.copy(a,s),a}return n},e.exports=n},{"../utils/buffer":20,"./polynomial":12}],15:[function(t,e,r){var n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return n[t]},r.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e}},{}],16:[function(t,e,r){var n=t("../utils/buffer"),o=t("./utils"),i=t("./error-correction-code"),s=t("./error-correction-level"),a=t("./byte-data"),f=7973,u=o.getBCHDigit(f),l=function(t,e){for(var n=1;n<=40;n++)if(t<=r.getCapacity(n,e))return n};r.isValidVersion=function(t){return!isNaN(t)&&t>=1&&t<=40},r.getCapacity=function(t,e){if(!r.isValidVersion(t))throw new Error("Invalid QR Code version");var n=o.getSymbolTotalCodewords(t),s=i.getTotalCodewordsCount(t,e),f=8*(n-s),u=a.getCharCountIndicator(t)+4;return Math.floor((f-u)/8)},r.getBestVersionForData=function(t,e){var r;r=t instanceof a?t.getLength():n.isBuffer(t)?t.length:new n(t).length;var o=e;return"undefined"==typeof o&&(o=s.H),l(r,o)},r.getEncodedBits=function(t){if(!r.isValidVersion(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;o.getBCHDigit(e)-u>=0;)e^=f<<o.getBCHDigit(e)-u;return t<<12|e}},{"../utils/buffer":20,"./byte-data":4,"./error-correction-code":5,"./error-correction-level":6,"./utils":15}],17:[function(t,e,r){var n=t("./renderer/qrcode-draw.js");n.qrcodedraw=n.QRCodeDraw,e.exports=n},{"./renderer/qrcode-draw.js":18}],18:[function(t,e,r){function n(){}var o=t("../core/qrcode"),i=t("../core/error-correction-level");r.QRCodeDraw=n,r.QRErrorCorrectLevel=i,r.QRCode=o,n.prototype={scale:4,defaultMargin:20,marginScaleFactor:5,color:{dark:"black",light:"white"},QRErrorCorrectLevel:i,draw:function(t,e,r,n){var i,s=Array.prototype.slice.call(arguments);if(n=s.pop(),t=s.shift(),e=s.shift(),r=s.shift()||{},"function"!=typeof n)throw new Error("callback required");"object"!=typeof r&&(r.errorCorrectLevel=r),this.scale=r.scale||this.scale,this.margin="undefined"==typeof r.margin?this.defaultMargin:r.margin;try{var a=new o(r.version,r.errorCorrectLevel),f=this.scale||4,u=t.getContext("2d"),l=0;a.addData(e),a.make();var h=this.marginWidth(),c=h;l=this.dataWidth(a)+2*h,this.resetCanvas(t,u,l);for(var d=0,g=a.getModuleCount();d<g;d++){for(var v=h,p=0,y=a.getModuleCount();p<y;p++)a.isDark(d,p)?(u.fillStyle=this.color.dark,u.fillRect(v,c,f,f)):this.color.light&&(u.fillStyle=this.color.light,u.fillRect(v,c,f,f)),v+=f;c+=f}}catch(t){i=t}n(i,t,l)},drawBitArray:function(){var t,e=Array.prototype.slice.call(arguments),r=e.pop(),n=e.shift(),i=e.shift()||{};if("function"!=typeof r)throw new Error("callback required as last argument");try{var s,a=new o(i.version,i.errorCorrectLevel),f=0,u=0;a.addData(n),a.make(),f=this.dataWidth(a,1),s=new Array(f*f);for(var l=0,h=a.getModuleCount();l<h;l++)for(var c=0,d=a.getModuleCount();c<d;c++)a.isDark(l,c)?s[u]=1:s[u]=0,u++}catch(e){t=e,console.log(e.stack)}r(t,s,f)},marginWidth:function(){var t=this.margin;return this.scale=this.scale||4,this.scale*this.marginScaleFactor>t&&t>0&&(t=this.scale*this.marginScaleFactor),t},dataWidth:function(t,e){return t.getModuleCount()*(e||this.scale||4)},resetCanvas:function(t,e,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.style.height=t.height=r,t.style.width=t.width=r,this.color.light?(e.fillStyle=this.color.light,e.fillRect(0,0,t.width,t.height)):e.clearRect(0,0,t.width,t.height)}}},{"../core/error-correction-level":6,"../core/qrcode":13}],19:[function(t,e,r){e.exports=Array.isArray||function(t){return"[object Array]"==={}.toString.call(t)}},{}],20:[function(t,e,r){"use strict";function n(t,e,r){return"number"==typeof t?a(t):p(t,e,r)}function o(t){if(t>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return 0|t}function i(t){return t!==t}function s(t){var e=new Uint8Array(t);return e.__proto__=n.prototype,e}function a(t){return s(t<0?0:0|o(t))}function f(t){var e=0|d(t),r=s(e),n=r.write(t);return n!==e&&(r=r.slice(0,n)),r}function u(t){for(var e=t.length<0?0:0|o(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");var o;return o=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),o.__proto__=n.prototype,o}function h(t){if(n.isBuffer(t)){var e=0|o(t.length),r=s(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||i(t.length)?s(0):u(t);if("Buffer"===t.type&&Array.isArray(t.data))return u(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function c(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function d(t){if(n.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;return 0===e?0:c(t).length}function g(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function v(t,e,r,n){return g(c(e,t.length-r),t,r,n)}function p(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?l(t,e,r):"string"==typeof t?f(t,e):h(t)}var y=t("./is-array"),w=2147483647;n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),n.prototype.write=function(t,e,r){void 0===e?(r=this.length,e=0):void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return v(this,t,e,r)},n.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var o=this.subarray(t,e);return o.__proto__=n.prototype,o},n.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},n.prototype.fill=function(t,e,r){if("string"==typeof t){if("string"==typeof e?(e=0,r=this.length):"string"==typeof r&&(r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var i;if("number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=n.isBuffer(t)?t:new n(t),a=s.length;for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this},n.concat=function(t,e){if(!y(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s(null,0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var o=a(e),i=0;for(r=0;r<t.length;++r){var f=t[r];if(!n.isBuffer(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(o,i),i+=f.length}return o},n.byteLength=d,n.prototype._isBuffer=!0,n.isBuffer=function(t){return!(null==t||!t._isBuffer)},e.exports=n},{"./is-array":19}]},{},[17])(17)});
//# sourceMappingURL=qrcode.min.js.map
{
"name": "qrcode",
"description": "QRCode / 2d Barcode api with both server side and client side support using canvas",
"version": "0.5.0",
"version": "0.6.0",
"author": "Ryan Day <soldair@gmail.com>",
"contributors": [
"vigreco"
"Vincenzo Greco <greco.vincenzo@gmail.com>"
],

@@ -14,9 +14,20 @@ "keywords": [

],
"main": "./qrcode.js",
"browser": "./lib/qrcode-draw.js",
"main": "./lib/index.js",
"browser": {
"./lib/index.js": "./lib/browser.js",
"./lib/utils/buffer.js": "./lib/utils/typedarray-buffer.js"
},
"files": [
"bin",
"build",
"lib"
],
"homepage": "http://github.com/soldair/node-qrcode",
"license": "MIT",
"scripts": {
"pretest": "node build.js",
"prepublish": "node build.js",
"test": "tap test/url.js test/svg.js"
"lint": "standard",
"pretest": "npm run lint",
"test": "node test.js",
"build": "node build.js",
"prepublish": "npm run build"
},

@@ -28,12 +39,12 @@ "bin": {

"canvas": "~1.3.4",
"colors": "*",
"bops": "0.0.6"
"colors": "*"
},
"devDependencies": {
"browserify": "~2.29.0",
"browserify": "^13.1.1",
"canvasutil": "*",
"express": "2.5.x",
"libxmljs": "^0.18.0",
"standard": "*",
"tap": "*",
"uglify-js": "1.2.x"
"uglify-js": "^2.7.4"
},

@@ -45,4 +56,10 @@ "repository": {

"engines": {
"node": ">= 0.6.0"
"node": ">= 0.10"
},
"standard": {
"ignore": [
"build/",
"examples/vendors/"
]
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc