Barcode & QR Generator App
Table of Contents
Project Overview
A client-side matrix barcode and QR code synthesis application. It enables instant creation of customized 2D QR codes and 1D barcodes with adjustable error correction, schema-specific payload formatting, and high-resolution multi-format asset exports.
Problem Statement
Many online QR code generators route user inputs through remote servers to log scan parameters, inject advertisement redirects, or impose subscriptions for basic vector downloads. Users and developers need a fast, private, client-side utility that generates production-ready codes directly in the browser without tracking or telemetry.
Solution Architecture
Raw input is shaped by schema-specific formatters, encoded into a module matrix, then split into two render targets (a rasterized canvas and a mathematically generated SVG), each with its own export path.
Technical Deep Dives
Standardized Schema Payload Structuring
- Wi-Fi:
WIFI:T:WPA;S:NetworkName;P:Password;; - vCard 3.0: Formatted contact cards containing name, email, telephone, and address keys.
- Direct URI / Text: Encoded URL strings and plain-text blocks.
Canvas Matrix Rendering & Error Correction
- Rendered matrices directly to an HTML5
<canvas>context using configurable Reed-Solomon error correction levels (Low 7%, Medium 15%, Quartile 25%, High 30%), keeping codes readable even if partially damaged or obscured by logos. - Added dynamic padding, quiet-zone enforcement, and foreground/background contrast verification to guarantee camera decode compliance.
Lossless Vector & Raster Export Pipeline
- Raster downloads (PNG, JPEG at 1×, 2×, 4× pixel densities) via
canvas.toDataURL(). - Mathematical vector exports (SVG) constructed by looping over active matrix modules and generating discrete
<rect>elements.
Algorithm & Complexity Benchmarks
Reed-Solomon & Matrix Encode
sub-10ms local renderO(M + S²) Space: O(S²) Encodes M payload bytes into an S×S QR error-corrected module matrix.
SVG Vector Construction
lossless at any DPIO(S²) Space: O(S²) Direct module-to-rect emission bypasses server image pipelines.
Architecture Trade-Offs
Dual Raster & Vector Output
Generates both print-ready lossless SVG and 1×/2×/4× PNG/JPEG exports in under 10ms locally—preserving complete user privacy.
Client-Only Execution
Wi-Fi credentials and vCard payloads never leave the user’s browser, eliminating server latency and data retention risk.
Project Results
Privacy-First
100% of encoding occurs in-browser; zero bytes of user data leave the client.
Instant Generation
Synthesizes codes with sub-10ms render latency.
Export Flexibility
Delivers both web-ready raster assets and print-ready lossless SVG vectors.