PageSourceSearch

https://www.hnu.edu.cn/system/resource/qrcode/js/jquery.qrcode.js

js hnu.edu.cn collected 2026-10-01 10:31:32 UTC 2,961 bytes, 1 lines download raw bytes

1(function($){$.fn.qrcode=function(options){if(typeof options==="string"){options={text:options}}options.text=utf16to8(options.text);options=$.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:QRErrorCorrectLevel.H,background:"#ffffff",foreground:"#000000",logo:""},options);var createCanvas=function(){var qrcode=new QRCode(options.typeNumber,options.correctLevel);qrcode.addData(options.text);qrcode.make();var canvas=document.createElement("canvas");canvas.width=options.width;canvas.height=options.height;var ctx=canvas.getContext("2d");var tileW=options.width/qrcode.getModuleCount();var tileH=options.height/qrcode.getModuleCount();for(var row=0;row<qrcode.getModuleCount();row++){for(var col=0;col<qrcode.getModuleCount();col++){ctx.fillStyle=qrcode.isDark(row,col)?options.foreground:options.background;var w=(Math.ceil((col+1)*tileW)-Math.floor(col*tileW));var h=(Math.ceil((row+1)*tileW)-Math.floor(row*tileW));ctx.fillRect(Math.round(col*tileW),Math.round(row*tileH),w,h)}}if(options.logo!=""){var image=new Image();image.onload=function(){var w=image.width;var h=image.height;ctx.drawImage(image,(options.width-w)/2,(options.height-h)/2)};image.src=options.logo}return canvas};var createTable=function(){var qrcode=new QRCode(options.typeNumber,options.correctLevel);qrcode.addData(options.text);qrcode.make();var $table=$("<table></table>").css("width",options.width+"px").css("height",options.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",options.background);var tileW=options.width/qrcode.getModuleCount();var tileH=options.height/qrcode.getModuleCount();for(var row=0;row<qrcode.getModuleCount();row++){var $row=$("<tr></tr>").css("height",tileH+"px").appendTo($table);for(var col=0;col<qrcode.getModuleCount();col++){$("<td></td>").css("width",tileW+"px").css("background-color",qrcode.isDark(row,col)?options.foreground:options.background).appendTo($row)}}if(options.logo!=""){$table.css("position","absolute").css("z-index","0");var divContainer=$("<div></div>").css("width",options.width+"px").css("height",options.height+"px").css("position","relative");var logoDiv=$("<div></div>").css("width",options.width+"px").css("height",options.height+"px").css("background","url("+options.logo+") no-repeat center center").css("position","absolute").css("z-index","1");divContainer.append(logoDiv);divContainer.append($table);return divContainer}return $table};return this.each(function(){var element=options.render=="canvas"?createCanvas():createTable();$(element).appendTo(this)})}})(jQuery);function utf16to8(str){var out,i,len,c;out="";len=str.length;for(i=0;i<len;i++){c=str.charCodeAt(i);if((c>=1)&&(c<=127)){out+=str.charAt(i)}else{if(c>2047){out+=String.fromCharCode(224|((c>>12)&15));out+=String.fromCharCode(128|((c>>6)&63));out+=String.fromCharCode(128|((c>>0)&63))}else{out+=String.fromCharCode(192|((c>>6)&31));out+=String.fromCharCode(128|((c>>0)&63))}}}return out};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.