Skip to content

cagrico/qrcodekit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qrcodekit

QRCodeKit Logo

qrcodekit is a professional, extensible, and high-performance QR Code generation library for Go. Designed for backend developers, e-commerce systems, and print-ready applications.

🚀 Features

  • Simple & Fluent API: Generate QR codes in a single line.
  • Advanced Styling:
    • Custom Shapes: Rounded, Circle, Square.
    • Linear & Radial Gradients.
    • Custom Eye styling.
  • Logo Overlay:
    • Auto-scaling logo support.
    • Smart error-correction upgrade ensures readability.
    • Background plates for logos.
  • Dual Engine:
    • SVG: Vector-perfect, print-ready, CSS-compatible.
    • PNG: High-quality raster with anti-aliasing (using bicubic interpolation).
  • Payload Builders: Helpers for WiFi, vCard, Bitcoin, Email, SMS, etc.
  • Zero-Config Defaults: Works out of the box with sensible defaults.

📦 Installation

go get github.com/cagrico/qrcodekit

⚡ Quick Start

Simple URL

package main

import (
    "os"
    "github.com/cagrico/qrcodekit"
    "github.com/cagrico/qrcodekit/payload"
)

func main() {
    qr, _ := qrcodekit.New(
        qrcodekit.Content(payload.URL("https://example.com")),
    )
    
    // Save as PNG
    pngData, _ := qr.PNG(512)
    os.WriteFile("qr.png", pngData, 0644)
}

🎨 Advanced Styling

Generate beautiful QR codes for marketing materials:

qr, _ := qrcodekit.New(
    qrcodekit.Content(payload.URL("https://example.com")),
    qrcodekit.WithModuleStyle(style.ModuleStyle{
        Shape:        style.ShapeRounded,
        BorderRadius: 0.4,
        Gradient:     style.LinearGradient(
            color.RGBA{0, 0, 255, 255}, 
            color.RGBA{0, 255, 255, 255}, 
            style.GradientDiagonal,
        ),
    }),
)

svgData, _ := qr.SVG(512)

🖼️ Logo Overlay

Add your brand logo with ease. The library automatically handle error correction levels.

lg, _ := logo.Load("logo.png")

qr, _ := qrcodekit.New(
    qrcodekit.Content(payload.URL("https://mysite.com")),
    qrcodekit.WithLogo(lg),
    qrcodekit.WithColors(color.Black, color.White),
)

📊 Benchmarks

Format Op/s Latency
SVG ~3750 0.28ms
PNG ~670 2.10ms

SVG generation is extremely fast and recommended for web/print usage.

🛠️ Extensibility

The library is designed with interfaces (Renderer, Payload) allowing you to implement custom renderers (e.g., PDF, Canvas) or custom payload types easily.

License

MIT

About

Extensible QR code generator library for Go with SVG-first rendering and branding features.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages