Socket
Socket
Sign inDemoInstall

qrjs

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qrjs - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

bower.json
{
"name": "qr.js",
"name": "qrjs",
"main": "qr.js",
"version": "0.1.0",
"version": "0.1.2",
"homepage": "https://github.com/educastellano/qr.js",

@@ -6,0 +6,0 @@ "authors": [

{
"name": "qrjs",
"version": "0.1.1",
"version": "0.1.2",
"description": "QR code generator in Javascript",

@@ -5,0 +5,0 @@ "main": "qr.js",

@@ -735,2 +735,40 @@ /* qr.js -- QR code generator in Javascript (revision 2011-01-19)

'generateSVG': function(data, options) {
options = options || {};
var matrix = QRCode['generate'](data, options);
var n = matrix.length;
var modsize = Math.max(options.modulesize || 5, 0.5);
var margin = Math.max(options.margin !== null ? options.margin : 4, 0.0);
var size = modsize * (n + 2 * margin);
var common = ' class= "fg"'+' width="'+modsize+'" height="'+modsize+'"/>';
var e = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
e.setAttribute('viewBox', '0 0 '+size+' '+size);
e.setAttribute('style', 'shape-rendering:crispEdges');
if (options.modulesize) {
e.setAttribute('width', size);
e.setAttribute('height', size);
}
var svg = [
'<style scoped>.bg{fill:#FFF}.fg{fill:#000}</style>',
'<rect class="bg" x="0" y="0"',
'width="'+size+'" height="'+size+'"/>',
];
var yo = margin * modsize;
for (var y = 0; y < n; ++y) {
var xo = margin * modsize;
for (var x = 0; x < n; ++x) {
if (matrix[y][x])
svg.push('<rect x="'+xo+'" y="'+yo+'"', common);
xo += modsize;
}
yo += modsize;
}
e.innerHTML = svg.join('');
return e;
},
'generatePNG': function(data, options) {

@@ -737,0 +775,0 @@ options = options || {};

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