PHPackages                             fastqr/fastqr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. fastqr/fastqr

ActiveLibrary[Image &amp; Media](/categories/media)

fastqr/fastqr
=============

Fast QR code generator with UTF-8 support, custom colors, logo embedding, and precise size control

v1.0.26(8mo ago)411051[1 issues](https://github.com/tranhuucanh/fastqr/issues)LGPL-2.1C++PHP &gt;=7.4CI passing

Since Oct 19Pushed 4mo agoCompare

[ Source](https://github.com/tranhuucanh/fastqr)[ Packagist](https://packagist.org/packages/fastqr/fastqr)[ Docs](https://github.com/tranhuucanh/fastqr)[ RSS](/packages/fastqr-fastqr/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (1)Versions (27)Used By (0)

FastQR
======

[](#fastqr)

**The fastest QR code generator on the planet.** 🚀

Generate 1,000 QR codes in **0.37 seconds**. Full UTF-8 support. Custom colors. Logo embedding. Precise size control.

[![GitHub Stars](https://camo.githubusercontent.com/fe7f57678947ae665e71b313c00d0550bd870e429a59e49d3f57b85fd1a22175/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f7472616e68757563616e682f6661737471723f7374796c653d736f6369616c)](https://github.com/tranhuucanh/fastqr/stargazers)[![GitHub Forks](https://camo.githubusercontent.com/09b2ef53a42da55c2a4db5be7b337b3c661b95b4088bf4afd963a6a698537077/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f7472616e68757563616e682f6661737471723f7374796c653d736f6369616c)](https://github.com/tranhuucanh/fastqr/network/members)[![Ask DeepWiki](https://camo.githubusercontent.com/0f5ae213ac378635adeb5d7f13cef055ad2f7d9a47b36de7b1c67dbe09f609ca/68747470733a2f2f6465657077696b692e636f6d2f62616467652e737667)](https://deepwiki.com/tranhuucanh/fastqr)

[Installation](#-installation) • [Quick Start](#-quick-start) • [Documentation](#-documentation) • [Benchmarks](#-performance-benchmarks)

---

### 🛠️ Tech Stack &amp; 📊 Stats

[](#️-tech-stack---stats)

[![License](https://camo.githubusercontent.com/e7a46e7a312debd4f79ea233a5ca6a51982703fc4bb11d90c69ba81420b3757b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4c47504c253230322e312d626c75652e737667)](LICENSE)[![C++](https://camo.githubusercontent.com/e19c5e3f8d06a00cc41aa847af5531a334861b95e4bd4dd1a8a74a8446e451d3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f432b2b2d31342d626c75652e737667)](https://isocpp.org/)[![C](https://camo.githubusercontent.com/03bdc5f87c735f01143cc5d4e42ddf45dad6ec5d87c8063c8b3b15ad6e25c971/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f432d31312d626c75652e737667)](https://en.wikipedia.org/wiki/C11_(C_standard_revision))[![CMake](https://camo.githubusercontent.com/83dd912ff8a7ccc36193b70093b9a589a5c4489c8a6a0518e6c7689bfb3a0405/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434d616b652d332e31302b2d3036344638432e737667)](https://cmake.org/)[![Shell](https://camo.githubusercontent.com/d04afe97d854fa0645e25c26c96639d840b4150e00cadf4ac63e8ce9d73b92f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5368656c6c2d426173682d3445414132352e737667)](https://www.gnu.org/software/bash/)[![JavaScript](https://camo.githubusercontent.com/48ac1e2b000bc7eb20d2e8524e4ed5df828309b50f8b9ab0b4a688c094fc6d14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a6176615363726970742d4553362b2d4637444631452e737667)](https://www.ecma-international.org/ecma-262/)

💎 **Ruby:** [![Gem](https://camo.githubusercontent.com/776bf91dc5460a1987b2f07ac6d847d0b253894316b1f7701aa811a4307f70d1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f47656d2d6661737471722d7265642e737667)](https://rubygems.org/gems/fastqr) [![Gem Downloads](https://camo.githubusercontent.com/acb2013bab7fad56b6ce48eb9bf4310a0c56a97a0987c8113a756d2587c10898/68747470733a2f2f62616467656e2e6e65742f7275627967656d732f64742f666173747172)](https://rubygems.org/gems/fastqr)

🟢 **Node.js:** [![npm](https://camo.githubusercontent.com/cac086f61512353b0668d111c2313258d7c30c72bb45943431ed87397a34ac2e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e706d2d6661737471722d2d70726f2d677265656e2e737667)](https://www.npmjs.com/package/fastqr-pro) [![npm downloads](https://camo.githubusercontent.com/53a94afc6c7609cc2891fa06a9e86f63d4740e43ca52ac06981bd7fcfb61d53e/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64742f6661737471722d70726f)](https://www.npmjs.com/package/fastqr-pro)

🐘 **PHP:** [![Composer](https://camo.githubusercontent.com/4af62989a41cb8698477c3a615194fd7b06e08a6ff18bc9bb70fb0a64eb18f9e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d6661737471722d626c75652e737667)](https://packagist.org/packages/fastqr/fastqr) [![Packagist Downloads](https://camo.githubusercontent.com/511bc5ef60a2ad1f9e229cad55657f06f024f739d8ae6b4c65236e0ecba20134/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6661737471722f666173747172)](https://packagist.org/packages/fastqr/fastqr)

📦 **CLI:** [![GitHub Downloads](https://camo.githubusercontent.com/7d52b75b23a92f8f332d737012a853b5ac162be3464998924a8a7c4ee8cadbda/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f7472616e68757563616e682f6661737471722f746f74616c)](https://github.com/tranhuucanh/fastqr/releases)

---

📑 Table of Contents
-------------------

[](#-table-of-contents)

- [Performance Benchmarks](#-performance-benchmarks)
- [Key Features](#-key-features)
- [Installation](#-installation)
- [Quick Start](#-quick-start)
- [API Reference](#-api-reference)
- [Documentation](#-documentation)
- [Architecture](#%EF%B8%8F-architecture)
- [License](#-license)
- [Contributing](#-contributing)
- [Bug Reports](#-bug-reports)
- [Support This Project](#-support-this-project)
- [Roadmap](#%EF%B8%8F-roadmap)
- [Contact &amp; Support](#-contact--support)
- [Acknowledgments](#-acknowledgments)

---

🔥 Performance Benchmarks
------------------------

[](#-performance-benchmarks)

**Generate 1,000 QR codes (500×500px)**

PlatformFastQR BatchCompetitorCompetitor Time🚀 Speedup⌨️ **CLI****0.37s** ⚡qrencode2.97s**8x**💎 **Ruby****0.38s** ⚡rqrcode59.45s**157x** 🏆🟢 **Node.js****0.46s** ⚡qrcode17.25s**37x**🐘 **PHP****0.64s** ⚡endroid/qr-code14.72s**23x****Average: 56x faster than popular alternatives!** 🎯

📊 **CLI Performance: FastQR vs qrencode**
*Task: Generate 1,000 QR codes (500×500px)*

LibrarySequential ModeBatch ModeSpeedup**FastQR**2.56s 🚀**0.37s** ⚡**8x faster** with batchqrencode2.97s 🐌❌ Not supported-**FastQR is 16% faster in sequential mode and 8x faster with batch mode!**

💎 **Ruby Performance: FastQR vs rqrcode**
*Task: Generate 1,000 QR codes (500×500px)*

LibrarySequential ModeBatch ModeSpeedup**FastQR**3.49s 🚀**0.38s** ⚡**17x faster** with batchrqrcode59.45s 🐢❌ Not supported-**FastQR is 17x faster in sequential mode and 157x faster with batch mode!**

🟢 **Node.js Performance: FastQR vs qrcode**
*Task: Generate 1,000 QR codes (500×500px)*

LibrarySequential ModeBatch ModeSpeedup**FastQR**2.43s 🚀**0.46s** ⚡**7x faster** with batchqrcode17.25s 🐌❌ Not supported-**FastQR is 7x faster in sequential mode and 37x faster with batch mode!**

🐘 **PHP Performance: FastQR vs endroid/qr-code**
*Task: Generate 1,000 QR codes (500×500px)*

LibrarySequential ModeBatch ModeSpeedup**FastQR**1.75s 🚀**0.64s** ⚡**8.4x faster** with batchendroid/qr-code14.72s 🐌❌ Not supported-**FastQR is 8.4x faster in sequential mode and 23x faster with batch mode!**

---

💪 Key Features
--------------

[](#-key-features)

### ⚡ Performance

[](#-performance)

- **Up to 157x faster** than alternatives
- **Batch mode**: 1,000 QR codes in 0.37s
- Zero process forking overhead
- Optimized C++ core

### 🎨 Customization

[](#-customization)

- **Custom colors** (RGB for QR &amp; background)
- **Logo embedding** with auto-scaling
- **Exact size control** (e.g., 2000×2000px)
- **Multiple formats**: PNG, JPG, WebP

### 🌐 UTF-8 Support

[](#-utf-8-support)

- Vietnamese, Japanese, Chinese
- Emoji and special characters
- All Unicode characters supported

### 🔧 Multi-Language

[](#-multi-language)

- Ruby, Node.js, PHP, C++
- Native bindings for each language
- Consistent API across platforms

---

📦 Installation
--------------

[](#-installation)

### 🍎 macOS

[](#-macos)

```
brew tap tranhuucanh/fastqr
brew install fastqr
```

### 🐧 Linux

[](#-linux)

```
# x86_64
# Download latest release (replace VERSION with latest version, e.g., 1.0.26)
VERSION="1.0.26"
wget https://github.com/tranhuucanh/fastqr/releases/download/v${VERSION}/fastqr-${VERSION}-linux-x86_64.tar.gz
tar -xzf fastqr-${VERSION}-linux-x86_64.tar.gz
sudo cp linux-x86_64/bin/fastqr /usr/local/bin/
sudo chmod +x /usr/local/bin/fastqr

# Verify installation
fastqr --version

# ARM64
VERSION="1.0.26"
wget https://github.com/tranhuucanh/fastqr/releases/download/v${VERSION}/fastqr-${VERSION}-linux-aarch64.tar.gz
tar -xzf fastqr-${VERSION}-linux-aarch64.tar.gz
sudo cp linux-aarch64/bin/fastqr /usr/local/bin/
sudo chmod +x /usr/local/bin/fastqr
```

### 💎 Ruby

[](#-ruby)

```
gem install fastqr
```

### 🟢 Node.js

[](#-nodejs)

```
npm install fastqr-pro
```

### 🐘 PHP

[](#-php)

```
composer require fastqr/fastqr
```

### 🔨 Build from Source

[](#-build-from-source)

```
git clone https://github.com/tranhuucanh/fastqr.git
cd fastqr && mkdir build && cd build
cmake .. && make && sudo make install
```

---

🎯 Quick Start
-------------

[](#-quick-start)

### CLI

[](#cli)

```
# Single QR code
fastqr "Hello World" output.png

# With custom colors
fastqr -s 500 -f 255,0,0 -b 255,255,200 "Red QR" red.png

# With margin (ISO standard: 4 modules)
fastqr -s 400 --margin-modules 4 "QR with margin" margin.png

# With logo
fastqr -l logo.png "QR with Logo" branded.png

# Batch mode (8x faster!)
fastqr -F urls.txt output_dir/
```

💎 **Ruby**```
require 'fastqr'

# Single QR
FastQR.generate("Hello World", "qr.png", size: 500)

# Batch mode (157x faster!)
urls = (1..1000).map { |i| "https://example.com/user/#{i}" }
FastQR.generate_batch(urls, "output/")

# With colors and logo
FastQR.generate("https://example.com", "branded.png",
  size: 800,
  foreground: [255, 0, 0],
  background: [255, 255, 200],
  logo: "logo.png",
  logoSize: 20,
  errorLevel: "H"
)
```

[Full Ruby Guide →](docs/RUBY_USAGE.md)

🟢 **Node.js**```
const fastqr = require('fastqr-pro');

// Single QR
fastqr.generate('Hello World', 'qr.png', { size: 500 });

// Batch mode (37x faster!)
const urls = Array.from({length: 1000}, (_, i) => `https://example.com/user/${i+1}`);
fastqr.generateBatch(urls, 'output/');

// With colors and logo
fastqr.generate('https://example.com', 'branded.png', {
  size: 800,
  foreground: [255, 0, 0],
  background: [255, 255, 200],
  logo: 'logo.png',
  logoSize: 20,
  errorLevel: 'H'
});
```

[Full Node.js Guide →](docs/NODEJS_USAGE.md)

🐘 **PHP**```
use FastQR\FastQR;

// Single QR
FastQR::generate('Hello World', 'qr.png', ['size' => 500]);

// Batch mode (23x faster!)
$urls = array_map(fn($i) => "https://example.com/user/$i", range(1, 1000));
FastQR::generateBatch($urls, 'output/');

// With colors and logo
FastQR::generate('https://example.com', 'branded.png', [
    'size' => 800,
    'foreground' => [255, 0, 0],
    'background' => [255, 255, 200],
    'logo' => 'logo.png',
    'logoSize' => 20,
    'errorLevel' => 'H'
]);
```

[Full PHP Guide →](docs/PHP_USAGE.md)

⚙️ **C++**```
#include

// Single QR
fastqr::QROptions options;
options.size = 500;
fastqr::generate("Hello World", "qr.png", options);

// Batch mode
std::vector urls;
for (int i = 1; i
