fastqr 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -2
- data/CMakeLists.txt +1 -1
- data/CONTRIBUTING.md +7 -1
- data/NOTICE +1 -1
- data/README.md +208 -140
- data/VERSION +1 -1
- data/bindings/nodejs/README.md +201 -138
- data/bindings/nodejs/index.d.ts +18 -2
- data/bindings/nodejs/index.js +30 -3
- data/bindings/nodejs/lib/platform.js +20 -0
- data/bindings/nodejs/package.json +1 -1
- data/bindings/nodejs/prebuilt/macos-arm64/bin/fastqr +0 -0
- data/bindings/nodejs/test/test.js +20 -0
- data/bindings/php/fastqr_php.cpp +2 -0
- data/bindings/php/src/FastQR.php +17 -5
- data/bindings/php/tests/FastQRTest.php +18 -2
- data/bindings/ruby/extconf.rb +18 -0
- data/bindings/ruby/fastqr_ruby.cpp +13 -0
- data/bindings/ruby/lib/fastqr/platform.rb +18 -0
- data/bindings/ruby/lib/fastqr/version.rb +19 -1
- data/bindings/ruby/lib/fastqr.rb +18 -0
- data/bindings/ruby/prebuilt/linux-aarch64/bin/fastqr +0 -0
- data/bindings/ruby/prebuilt/linux-aarch64/include/fastqr.h +6 -0
- data/bindings/ruby/prebuilt/linux-aarch64.tar.gz +0 -0
- data/bindings/ruby/prebuilt/linux-x86_64/bin/fastqr +0 -0
- data/bindings/ruby/prebuilt/linux-x86_64/include/fastqr.h +6 -0
- data/bindings/ruby/prebuilt/linux-x86_64.tar.gz +0 -0
- data/bindings/ruby/prebuilt/macos-arm64/bin/fastqr +0 -0
- data/bindings/ruby/prebuilt/macos-arm64/include/fastqr.h +6 -0
- data/bindings/ruby/prebuilt/macos-arm64.tar.gz +0 -0
- data/docs/CLI_USAGE.md +74 -5
- data/docs/NODEJS_USAGE.md +43 -22
- data/docs/PHP_USAGE.md +35 -8
- data/docs/README.md +10 -14
- data/docs/RUBY_USAGE.md +47 -25
- data/include/fastqr.h +6 -0
- data/prebuilt/README.md +2 -8
- data/scripts/README.md +14 -23
- data/scripts/update-version.sh +0 -6
- data/src/cli.cpp +25 -0
- data/src/fastqr.cpp +134 -43
- data/verify_batch_input.txt +1000 -0
- metadata +3 -21
- data/BUILD.md +0 -418
- data/DISTRIBUTION.md +0 -730
- data/INSTALL.md +0 -171
- data/PREBUILT.md +0 -171
- data/bindings/ruby/prebuilt/macos-x86_64/bin/fastqr +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64/include/fastqr.h +0 -147
- data/bindings/ruby/prebuilt/macos-x86_64/include/stb_image.h +0 -7988
- data/bindings/ruby/prebuilt/macos-x86_64/include/stb_image_write.h +0 -1724
- data/bindings/ruby/prebuilt/macos-x86_64.tar.gz +0 -0
- data/build.sh +0 -109
- data/composer.json +0 -35
- data/phpunit.xml +0 -18
- data/scripts/build-local.sh +0 -18
- data/scripts/install.sh +0 -87
- data/scripts/test-gem-local.sh +0 -64
- data/scripts/test-gem-manual.rb +0 -54
- data/scripts/test-npm-local.sh +0 -67
- data/scripts/test-npm-real.sh +0 -80
- data/test.sh +0 -86
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 866d0e478a45615cf1d5faf0bc7ecdabe498433b519482f41d675b571ae23b0b
|
|
4
|
+
data.tar.gz: 83ee54578961cc01b2abb01bbaa340beac82c11fc75548adf9ce33d415a9523a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90f13d8fd8f729b010949f9f27e3fc6406cd7f368ccd02cd873c52b4cdc65988f0936bb16393df1255c8b4055adcf6998f10f42b9f9edc0c36d7cf555d3fc1fa
|
|
7
|
+
data.tar.gz: 0c6ce4732fd19d6105a342e7a99a9b817a9f6fc2385fe3f3c5e857b6d30139c14634e4abc6890e5b149378af89235c383d79e96075c4d733fb52745f468adc62
|
data/CHANGELOG.md
CHANGED
|
@@ -43,8 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
43
43
|
|
|
44
44
|
### Documentation
|
|
45
45
|
- Comprehensive README with examples
|
|
46
|
-
-
|
|
47
|
-
- DISTRIBUTION.md with publishing guides for all package managers
|
|
46
|
+
- Complete usage guides for CLI, Ruby, Node.js, and PHP
|
|
48
47
|
- API documentation for all languages
|
|
49
48
|
|
|
50
49
|
[1.0.0]: https://github.com/tranhuucanh/fastqr/releases/tag/v1.0.0
|
data/CMakeLists.txt
CHANGED
data/CONTRIBUTING.md
CHANGED
|
@@ -55,7 +55,13 @@ Thank you for your interest in contributing to FastQR! This document provides gu
|
|
|
55
55
|
|
|
56
56
|
## 🏗️ Development Setup
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Build the project locally:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
mkdir build && cd build
|
|
62
|
+
cmake .. -DCMAKE_BUILD_TYPE=Debug
|
|
63
|
+
make
|
|
64
|
+
```
|
|
59
65
|
|
|
60
66
|
## 📄 License
|
|
61
67
|
|
data/NOTICE
CHANGED
|
@@ -8,4 +8,4 @@ This project statically links with:
|
|
|
8
8
|
Copyright (C) 2006-2017 Kentaro Fukuchi
|
|
9
9
|
|
|
10
10
|
As required by the LGPL, you can obtain and rebuild this library with modified
|
|
11
|
-
versions of libqrencode. See
|
|
11
|
+
versions of libqrencode. See the README for build instructions.
|
data/README.md
CHANGED
|
@@ -1,24 +1,83 @@
|
|
|
1
1
|
# FastQR
|
|
2
2
|
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<!-- Logo placeholder - add your logo here -->
|
|
6
|
+
<!-- <img src="docs/logo.png" alt="FastQR Logo" width="200"/> -->
|
|
7
|
+
|
|
8
|
+
**The fastest QR code generator on the planet.** 🚀
|
|
9
|
+
|
|
10
|
+
Generate 1,000 QR codes in **0.37 seconds**. Full UTF-8 support. Custom colors. Logo embedding. Precise size control.
|
|
11
|
+
|
|
12
|
+
[](https://github.com/tranhuucanh/fastqr/stargazers)
|
|
13
|
+
[](https://github.com/tranhuucanh/fastqr/network/members)
|
|
14
|
+
[](https://deepwiki.com/tranhuucanh/fastqr)
|
|
15
|
+
|
|
16
|
+
[Installation](#-installation) • [Quick Start](#-quick-start) • [Documentation](#-documentation) • [Benchmarks](#-performance-benchmarks)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
### 🛠️ Tech Stack & 📊 Stats
|
|
21
|
+
|
|
3
22
|
[](LICENSE)
|
|
4
23
|
[](https://isocpp.org/)
|
|
5
24
|
[](https://en.wikipedia.org/wiki/C11_(C_standard_revision))
|
|
6
25
|
[](https://cmake.org/)
|
|
7
26
|
[](https://www.gnu.org/software/bash/)
|
|
8
27
|
[](https://www.ecma-international.org/ecma-262/)
|
|
9
|
-
[](https://rubygems.org/gems/fastqr)
|
|
10
|
-
[](https://www.npmjs.com/package/fastqr-pro)
|
|
11
|
-
[](https://packagist.org/packages/fastqr/fastqr)
|
|
12
28
|
|
|
13
|
-
**
|
|
29
|
+
💎 **Ruby:** [](https://rubygems.org/gems/fastqr) [](https://rubygems.org/gems/fastqr)
|
|
14
30
|
|
|
15
|
-
|
|
31
|
+
🟢 **Node.js:** [](https://www.npmjs.com/package/fastqr-pro) [](https://www.npmjs.com/package/fastqr-pro)
|
|
32
|
+
|
|
33
|
+
🐘 **PHP:** [](https://packagist.org/packages/fastqr/fastqr) [](https://packagist.org/packages/fastqr/fastqr)
|
|
34
|
+
|
|
35
|
+
📦 **CLI:** [](https://github.com/tranhuucanh/fastqr/releases)
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 📑 Table of Contents
|
|
42
|
+
|
|
43
|
+
- [Performance Benchmarks](#-performance-benchmarks)
|
|
44
|
+
- [Key Features](#-key-features)
|
|
45
|
+
- [Installation](#-installation)
|
|
46
|
+
- [Quick Start](#-quick-start)
|
|
47
|
+
- [API Reference](#-api-reference)
|
|
48
|
+
- [Documentation](#-documentation)
|
|
49
|
+
- [Architecture](#️-architecture)
|
|
50
|
+
- [License](#-license)
|
|
51
|
+
- [Contributing](#-contributing)
|
|
52
|
+
- [Bug Reports](#-bug-reports)
|
|
53
|
+
- [Support This Project](#-support-this-project)
|
|
54
|
+
- [Roadmap](#️-roadmap)
|
|
55
|
+
- [Contact & Support](#-contact--support)
|
|
56
|
+
- [Acknowledgments](#-acknowledgments)
|
|
16
57
|
|
|
17
58
|
---
|
|
18
59
|
|
|
19
60
|
## 🔥 Performance Benchmarks
|
|
20
61
|
|
|
21
|
-
|
|
62
|
+
<div align="center">
|
|
63
|
+
|
|
64
|
+
**Generate 1,000 QR codes (500×500px)**
|
|
65
|
+
|
|
66
|
+
| Platform | FastQR Batch | Competitor | Competitor Time | 🚀 Speedup |
|
|
67
|
+
|----------|-------------:|------------|----------------:|-----------:|
|
|
68
|
+
| ⌨️ **CLI** | **0.37s** ⚡ | qrencode | 2.97s | **8x** |
|
|
69
|
+
| 💎 **Ruby** | **0.38s** ⚡ | rqrcode | 59.45s | **157x** 🏆 |
|
|
70
|
+
| 🟢 **Node.js** | **0.46s** ⚡ | qrcode | 17.25s | **37x** |
|
|
71
|
+
| 🐘 **PHP** | **0.64s** ⚡ | endroid/qr-code | 14.72s | **23x** |
|
|
72
|
+
|
|
73
|
+
**Average: 56x faster than popular alternatives!** 🎯
|
|
74
|
+
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<details open>
|
|
78
|
+
<summary>📊 <b>CLI Performance: FastQR vs qrencode</b></summary>
|
|
79
|
+
|
|
80
|
+
<br/>
|
|
22
81
|
|
|
23
82
|
*Task: Generate 1,000 QR codes (500×500px)*
|
|
24
83
|
|
|
@@ -29,9 +88,12 @@ Generate 1,000 QR codes in **0.37 seconds**. Full UTF-8 support. Custom colors.
|
|
|
29
88
|
|
|
30
89
|
**FastQR is 16% faster in sequential mode and 8x faster with batch mode!**
|
|
31
90
|
|
|
32
|
-
|
|
91
|
+
</details>
|
|
33
92
|
|
|
34
|
-
|
|
93
|
+
<details open>
|
|
94
|
+
<summary>💎 <b>Ruby Performance: FastQR vs rqrcode</b></summary>
|
|
95
|
+
|
|
96
|
+
<br/>
|
|
35
97
|
|
|
36
98
|
*Task: Generate 1,000 QR codes (500×500px)*
|
|
37
99
|
|
|
@@ -42,9 +104,12 @@ Generate 1,000 QR codes in **0.37 seconds**. Full UTF-8 support. Custom colors.
|
|
|
42
104
|
|
|
43
105
|
**FastQR is 17x faster in sequential mode and 157x faster with batch mode!**
|
|
44
106
|
|
|
45
|
-
|
|
107
|
+
</details>
|
|
108
|
+
|
|
109
|
+
<details open>
|
|
110
|
+
<summary>🟢 <b>Node.js Performance: FastQR vs qrcode</b></summary>
|
|
46
111
|
|
|
47
|
-
|
|
112
|
+
<br/>
|
|
48
113
|
|
|
49
114
|
*Task: Generate 1,000 QR codes (500×500px)*
|
|
50
115
|
|
|
@@ -55,9 +120,12 @@ Generate 1,000 QR codes in **0.37 seconds**. Full UTF-8 support. Custom colors.
|
|
|
55
120
|
|
|
56
121
|
**FastQR is 7x faster in sequential mode and 37x faster with batch mode!**
|
|
57
122
|
|
|
58
|
-
|
|
123
|
+
</details>
|
|
124
|
+
|
|
125
|
+
<details open>
|
|
126
|
+
<summary>🐘 <b>PHP Performance: FastQR vs endroid/qr-code</b></summary>
|
|
59
127
|
|
|
60
|
-
|
|
128
|
+
<br/>
|
|
61
129
|
|
|
62
130
|
*Task: Generate 1,000 QR codes (500×500px)*
|
|
63
131
|
|
|
@@ -68,67 +136,72 @@ Generate 1,000 QR codes in **0.37 seconds**. Full UTF-8 support. Custom colors.
|
|
|
68
136
|
|
|
69
137
|
**FastQR is 8.4x faster in sequential mode and 23x faster with batch mode!**
|
|
70
138
|
|
|
71
|
-
|
|
139
|
+
</details>
|
|
72
140
|
|
|
73
|
-
|
|
141
|
+
---
|
|
74
142
|
|
|
75
|
-
|
|
143
|
+
## 💪 Key Features
|
|
76
144
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
| **💎 Ruby** | rqrcode | 59.45s | ❌ | **157x faster** 🚀 |
|
|
81
|
-
| **🟢 Node.js** | qrcode | 17.25s | ❌ | **37x faster** ⚡ |
|
|
82
|
-
| **🐘 PHP** | endroid/qr-code | 14.72s | ❌ | **23x faster** 🚀 |
|
|
145
|
+
<table width="100%">
|
|
146
|
+
<tr>
|
|
147
|
+
<td width="50%">
|
|
83
148
|
|
|
84
|
-
|
|
149
|
+
### ⚡ Performance
|
|
150
|
+
- **Up to 157x faster** than alternatives
|
|
151
|
+
- **Batch mode**: 1,000 QR codes in 0.37s
|
|
152
|
+
- Zero process forking overhead
|
|
153
|
+
- Optimized C++ core
|
|
85
154
|
|
|
86
|
-
|
|
155
|
+
</td>
|
|
156
|
+
<td width="50%">
|
|
87
157
|
|
|
88
|
-
|
|
158
|
+
### 🎨 Customization
|
|
159
|
+
- **Custom colors** (RGB for QR & background)
|
|
160
|
+
- **Logo embedding** with auto-scaling
|
|
161
|
+
- **Exact size control** (e.g., 2000×2000px)
|
|
162
|
+
- **Multiple formats**: PNG, JPG, WebP
|
|
89
163
|
|
|
90
|
-
|
|
164
|
+
</td>
|
|
165
|
+
</tr>
|
|
166
|
+
<tr>
|
|
167
|
+
<td width="50%">
|
|
91
168
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
| **Full UTF-8 Support** | ✅ Vietnamese, Japanese, Chinese, emoji | ⚠️ Limited or none |
|
|
97
|
-
| **Custom Colors** | ✅ RGB foreground + background | ⚠️ Limited or none |
|
|
98
|
-
| **Logo Embedding** | ✅ Built-in logo support | ⚠️ Limited or none |
|
|
99
|
-
| **Language Bindings** | ✅ Ruby, Node.js, PHP, C++ | ✅ Usually supported |
|
|
100
|
-
| **Error Correction** | ✅ 4 levels (L, M, Q, H) | ✅ Usually supported |
|
|
169
|
+
### 🌐 UTF-8 Support
|
|
170
|
+
- Vietnamese, Japanese, Chinese
|
|
171
|
+
- Emoji and special characters
|
|
172
|
+
- All Unicode characters supported
|
|
101
173
|
|
|
102
|
-
|
|
174
|
+
</td>
|
|
175
|
+
<td width="50%">
|
|
103
176
|
|
|
104
|
-
|
|
177
|
+
### 🔧 Multi-Language
|
|
178
|
+
- Ruby, Node.js, PHP, C++
|
|
179
|
+
- Native bindings for each language
|
|
180
|
+
- Consistent API across platforms
|
|
105
181
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
- 🎨 **Custom Colors**: Choose any RGB color for QR code and background
|
|
110
|
-
- 📐 **Exact Size Control**: Generate QR codes with precise pixel dimensions (e.g., 2000×2000px)
|
|
111
|
-
- 🖼️ **Logo Embedding**: Add company logos to the center of QR codes
|
|
112
|
-
- 🛡️ **Error Correction**: Supports 4 levels (L, M, Q, H)
|
|
113
|
-
- 💾 **Multiple Formats**: PNG, JPG, WebP
|
|
114
|
-
- 🔧 **Multiple Languages**: Native bindings for Ruby, Node.js, PHP, and C++
|
|
182
|
+
</td>
|
|
183
|
+
</tr>
|
|
184
|
+
</table>
|
|
115
185
|
|
|
116
186
|
---
|
|
117
187
|
|
|
118
188
|
## 📦 Installation
|
|
119
189
|
|
|
120
|
-
|
|
190
|
+
<table>
|
|
191
|
+
<tr>
|
|
192
|
+
<td width="50%">
|
|
121
193
|
|
|
122
|
-
|
|
194
|
+
### 🍎 macOS
|
|
123
195
|
```bash
|
|
124
196
|
brew tap tranhuucanh/fastqr
|
|
125
197
|
brew install fastqr
|
|
126
198
|
```
|
|
127
199
|
|
|
128
|
-
|
|
200
|
+
### 🐧 Linux
|
|
129
201
|
```bash
|
|
130
|
-
#
|
|
131
|
-
VERSION
|
|
202
|
+
# x86_64
|
|
203
|
+
# Download latest release (replace VERSION with latest version, e.g., 1.0.26)
|
|
204
|
+
VERSION="1.0.26"
|
|
132
205
|
wget https://github.com/tranhuucanh/fastqr/releases/download/v${VERSION}/fastqr-${VERSION}-linux-x86_64.tar.gz
|
|
133
206
|
tar -xzf fastqr-${VERSION}-linux-x86_64.tar.gz
|
|
134
207
|
sudo cp linux-x86_64/bin/fastqr /usr/local/bin/
|
|
@@ -136,186 +209,172 @@ sudo chmod +x /usr/local/bin/fastqr
|
|
|
136
209
|
|
|
137
210
|
# Verify installation
|
|
138
211
|
fastqr --version
|
|
139
|
-
```
|
|
140
212
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
VERSION="1.0.21"
|
|
213
|
+
# ARM64
|
|
214
|
+
VERSION="1.0.26"
|
|
144
215
|
wget https://github.com/tranhuucanh/fastqr/releases/download/v${VERSION}/fastqr-${VERSION}-linux-aarch64.tar.gz
|
|
145
216
|
tar -xzf fastqr-${VERSION}-linux-aarch64.tar.gz
|
|
146
217
|
sudo cp linux-aarch64/bin/fastqr /usr/local/bin/
|
|
147
218
|
sudo chmod +x /usr/local/bin/fastqr
|
|
148
219
|
```
|
|
149
220
|
|
|
150
|
-
|
|
221
|
+
</td>
|
|
222
|
+
<td width="50%">
|
|
151
223
|
|
|
152
|
-
|
|
224
|
+
### 💎 Ruby
|
|
153
225
|
```bash
|
|
154
226
|
gem install fastqr
|
|
155
227
|
```
|
|
156
228
|
|
|
157
|
-
|
|
229
|
+
### 🟢 Node.js
|
|
158
230
|
```bash
|
|
159
231
|
npm install fastqr-pro
|
|
160
232
|
```
|
|
161
233
|
|
|
162
|
-
|
|
234
|
+
### 🐘 PHP
|
|
163
235
|
```bash
|
|
164
236
|
composer require fastqr/fastqr
|
|
165
237
|
```
|
|
166
238
|
|
|
167
|
-
### Build from Source
|
|
168
|
-
|
|
239
|
+
### 🔨 Build from Source
|
|
169
240
|
```bash
|
|
170
|
-
# Install dependencies
|
|
171
|
-
# macOS:
|
|
172
|
-
brew install qrencode libpng cmake
|
|
173
|
-
|
|
174
|
-
# Ubuntu/Debian:
|
|
175
|
-
sudo apt-get install libqrencode-dev libpng-dev cmake build-essential
|
|
176
|
-
|
|
177
|
-
# Build
|
|
178
241
|
git clone https://github.com/tranhuucanh/fastqr.git
|
|
179
|
-
cd fastqr
|
|
180
|
-
|
|
181
|
-
cmake ..
|
|
182
|
-
make
|
|
183
|
-
sudo make install
|
|
242
|
+
cd fastqr && mkdir build && cd build
|
|
243
|
+
cmake .. && make && sudo make install
|
|
184
244
|
```
|
|
185
245
|
|
|
186
|
-
|
|
246
|
+
</td>
|
|
247
|
+
</tr>
|
|
248
|
+
</table>
|
|
187
249
|
|
|
188
250
|
---
|
|
189
251
|
|
|
190
252
|
## 🎯 Quick Start
|
|
191
253
|
|
|
192
254
|
### CLI
|
|
193
|
-
|
|
194
|
-
**Single QR Code:**
|
|
195
255
|
```bash
|
|
256
|
+
# Single QR code
|
|
196
257
|
fastqr "Hello World" output.png
|
|
197
|
-
fastqr -s 500 -f 255,0,0 "Red QR" red.png
|
|
198
|
-
fastqr -s 500 -f 255,0,0 -b 142,142,142 "Red QR & Gray" red_and_gray.png
|
|
199
|
-
fastqr -l logo.png "QR with Logo" branded.png
|
|
200
|
-
```
|
|
201
258
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
# Create batch.txt with one text per line
|
|
205
|
-
echo "https://example.com/user/1" > batch.txt
|
|
206
|
-
echo "https://example.com/user/2" >> batch.txt
|
|
207
|
-
# ... add 1000 URLs
|
|
259
|
+
# With custom colors
|
|
260
|
+
fastqr -s 500 -f 255,0,0 -b 255,255,200 "Red QR" red.png
|
|
208
261
|
|
|
209
|
-
#
|
|
210
|
-
fastqr -
|
|
211
|
-
```
|
|
262
|
+
# With margin (ISO standard: 4 modules)
|
|
263
|
+
fastqr -s 400 --margin-modules 4 "QR with margin" margin.png
|
|
212
264
|
|
|
213
|
-
|
|
265
|
+
# With logo
|
|
266
|
+
fastqr -l logo.png "QR with Logo" branded.png
|
|
267
|
+
|
|
268
|
+
# Batch mode (8x faster!)
|
|
269
|
+
fastqr -F urls.txt output_dir/
|
|
270
|
+
```
|
|
214
271
|
|
|
215
|
-
|
|
272
|
+
<details>
|
|
273
|
+
<summary>💎 <b>Ruby</b></summary>
|
|
216
274
|
|
|
217
275
|
```ruby
|
|
218
276
|
require 'fastqr'
|
|
219
277
|
|
|
220
|
-
# Single QR
|
|
278
|
+
# Single QR
|
|
221
279
|
FastQR.generate("Hello World", "qr.png", size: 500)
|
|
222
280
|
|
|
223
|
-
# Batch mode
|
|
281
|
+
# Batch mode (157x faster!)
|
|
224
282
|
urls = (1..1000).map { |i| "https://example.com/user/#{i}" }
|
|
225
283
|
FastQR.generate_batch(urls, "output/")
|
|
226
|
-
# ⚡ Done in 0.38 seconds! (vs 59.45s with rqrcode)
|
|
227
284
|
|
|
228
|
-
#
|
|
285
|
+
# With colors and logo
|
|
229
286
|
FastQR.generate("https://example.com", "branded.png",
|
|
230
287
|
size: 800,
|
|
231
|
-
foreground: [255, 0, 0],
|
|
232
|
-
background: [255, 255, 200],
|
|
288
|
+
foreground: [255, 0, 0],
|
|
289
|
+
background: [255, 255, 200],
|
|
233
290
|
logo: "logo.png",
|
|
234
291
|
logoSize: 20,
|
|
235
|
-
errorLevel: "H"
|
|
292
|
+
errorLevel: "H"
|
|
236
293
|
)
|
|
237
294
|
```
|
|
238
295
|
|
|
239
|
-
|
|
296
|
+
[Full Ruby Guide →](docs/RUBY_USAGE.md)
|
|
297
|
+
</details>
|
|
240
298
|
|
|
241
|
-
|
|
299
|
+
<details>
|
|
300
|
+
<summary>🟢 <b>Node.js</b></summary>
|
|
242
301
|
|
|
243
302
|
```javascript
|
|
244
|
-
const fastqr = require('fastqr');
|
|
303
|
+
const fastqr = require('fastqr-pro');
|
|
245
304
|
|
|
246
|
-
// Single QR
|
|
305
|
+
// Single QR
|
|
247
306
|
fastqr.generate('Hello World', 'qr.png', { size: 500 });
|
|
248
307
|
|
|
249
|
-
// Batch mode
|
|
250
|
-
const urls = Array.from({length: 1000}, (_, i) =>
|
|
251
|
-
`https://example.com/user/${i+1}`
|
|
252
|
-
);
|
|
308
|
+
// Batch mode (37x faster!)
|
|
309
|
+
const urls = Array.from({length: 1000}, (_, i) => `https://example.com/user/${i+1}`);
|
|
253
310
|
fastqr.generateBatch(urls, 'output/');
|
|
254
|
-
// ⚡ Done in 0.46 seconds! (vs 17.25s with qrcode)
|
|
255
311
|
|
|
256
|
-
//
|
|
312
|
+
// With colors and logo
|
|
257
313
|
fastqr.generate('https://example.com', 'branded.png', {
|
|
258
314
|
size: 800,
|
|
259
|
-
foreground: [255, 0, 0],
|
|
260
|
-
background: [255, 255, 200],
|
|
315
|
+
foreground: [255, 0, 0],
|
|
316
|
+
background: [255, 255, 200],
|
|
261
317
|
logo: 'logo.png',
|
|
262
318
|
logoSize: 20,
|
|
263
|
-
errorLevel: 'H'
|
|
319
|
+
errorLevel: 'H'
|
|
264
320
|
});
|
|
265
321
|
```
|
|
266
322
|
|
|
267
|
-
|
|
323
|
+
[Full Node.js Guide →](docs/NODEJS_USAGE.md)
|
|
324
|
+
</details>
|
|
268
325
|
|
|
269
|
-
|
|
326
|
+
<details>
|
|
327
|
+
<summary>🐘 <b>PHP</b></summary>
|
|
270
328
|
|
|
271
329
|
```php
|
|
272
330
|
use FastQR\FastQR;
|
|
273
331
|
|
|
274
|
-
// Single QR
|
|
332
|
+
// Single QR
|
|
275
333
|
FastQR::generate('Hello World', 'qr.png', ['size' => 500]);
|
|
276
334
|
|
|
277
|
-
// Batch mode
|
|
335
|
+
// Batch mode (23x faster!)
|
|
278
336
|
$urls = array_map(fn($i) => "https://example.com/user/$i", range(1, 1000));
|
|
279
337
|
FastQR::generateBatch($urls, 'output/');
|
|
280
|
-
// Done in ~0.4 seconds!
|
|
281
338
|
|
|
282
|
-
//
|
|
339
|
+
// With colors and logo
|
|
283
340
|
FastQR::generate('https://example.com', 'branded.png', [
|
|
284
341
|
'size' => 800,
|
|
285
|
-
'foreground' => [255, 0, 0],
|
|
286
|
-
'background' => [255, 255, 200],
|
|
342
|
+
'foreground' => [255, 0, 0],
|
|
343
|
+
'background' => [255, 255, 200],
|
|
287
344
|
'logo' => 'logo.png',
|
|
288
345
|
'logoSize' => 20,
|
|
289
|
-
'errorLevel' => 'H'
|
|
346
|
+
'errorLevel' => 'H'
|
|
290
347
|
]);
|
|
291
348
|
```
|
|
292
349
|
|
|
293
|
-
|
|
350
|
+
[Full PHP Guide →](docs/PHP_USAGE.md)
|
|
351
|
+
</details>
|
|
294
352
|
|
|
295
|
-
|
|
353
|
+
<details>
|
|
354
|
+
<summary>⚙️ <b>C++</b></summary>
|
|
296
355
|
|
|
297
356
|
```cpp
|
|
298
357
|
#include <fastqr.h>
|
|
299
358
|
|
|
300
|
-
// Single QR
|
|
359
|
+
// Single QR
|
|
301
360
|
fastqr::QROptions options;
|
|
302
361
|
options.size = 500;
|
|
303
362
|
fastqr::generate("Hello World", "qr.png", options);
|
|
304
363
|
|
|
305
|
-
// Batch mode
|
|
364
|
+
// Batch mode
|
|
306
365
|
std::vector<std::string> urls;
|
|
307
366
|
for (int i = 1; i <= 1000; i++) {
|
|
308
367
|
urls.push_back("https://example.com/user/" + std::to_string(i));
|
|
309
368
|
}
|
|
310
369
|
fastqr::generateBatch(urls, "output/", options);
|
|
311
|
-
// Done in ~0.4 seconds!
|
|
312
370
|
```
|
|
371
|
+
</details>
|
|
313
372
|
|
|
314
373
|
---
|
|
315
374
|
|
|
316
375
|
## 📖 API Reference
|
|
317
376
|
|
|
318
|
-
###
|
|
377
|
+
### Common Options
|
|
319
378
|
|
|
320
379
|
| Option | Type | Default | Description |
|
|
321
380
|
|--------|------|---------|-------------|
|
|
@@ -328,6 +387,8 @@ fastqr::generateBatch(urls, "output/", options);
|
|
|
328
387
|
| `logoSize` | int | 20 | Logo size as percentage (1-50) |
|
|
329
388
|
| `quality` | int | 95 | Image quality for lossy formats (1-100) |
|
|
330
389
|
| `format` | string | 'png' | Output format: png, jpg, webp |
|
|
390
|
+
| `margin` | int | 0 | Margin (quiet zone) in pixels (absolute) |
|
|
391
|
+
| `marginModules` | int | 4 | Margin in modules (relative, ISO standard) |
|
|
331
392
|
|
|
332
393
|
### Error Correction Levels
|
|
333
394
|
|
|
@@ -412,29 +473,34 @@ Found a bug? Please open an issue with:
|
|
|
412
473
|
|
|
413
474
|
---
|
|
414
475
|
|
|
476
|
+
## 💖 Support This Project
|
|
477
|
+
|
|
478
|
+
If FastQR helps you save time and money, consider supporting its development:
|
|
479
|
+
- ⭐ Star this repository
|
|
480
|
+
- 🐛 Report bugs and suggest features
|
|
481
|
+
- 📖 Improve documentation
|
|
482
|
+
- 💬 Share FastQR with others
|
|
483
|
+
- ✍️ Write a blog post or tutorial
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
415
487
|
## 🗺️ Roadmap
|
|
416
488
|
|
|
417
|
-
|
|
418
|
-
- [ ] SVG output format
|
|
419
|
-
- [ ] Python bindings
|
|
420
|
-
- [ ] QR code scanning/decoding
|
|
421
|
-
- [ ] Advanced batch processing options
|
|
489
|
+
**Coming Soon:** Windows support • SVG output • Python bindings • Advanced batch processing options
|
|
422
490
|
|
|
423
491
|
---
|
|
424
492
|
|
|
425
|
-
## 📮 Contact
|
|
493
|
+
## 📮 Contact & Support
|
|
426
494
|
|
|
427
|
-
|
|
428
|
-
- **Issues**: [GitHub Issues](https://github.com/tranhuucanh/fastqr/issues)
|
|
495
|
+
**GitHub:** [@tranhuucanh](https://github.com/tranhuucanh) • [Issues](https://github.com/tranhuucanh/fastqr/issues) • [Discussions](https://github.com/tranhuucanh/fastqr/discussions)
|
|
429
496
|
|
|
430
497
|
---
|
|
431
498
|
|
|
432
499
|
## 🙏 Acknowledgments
|
|
433
500
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
- [stb libraries](https://github.com/nothings/stb) by Sean Barrett
|
|
501
|
+
Built with: **[libqrencode](https://fukuchi.org/works/qrencode/)** by Kentaro Fukuchi • **[libpng](http://www.libpng.org/pub/png/libpng.html)** by PNG Development Group • **[stb](https://github.com/nothings/stb)** by Sean Barrett
|
|
502
|
+
|
|
503
|
+
Thanks to all [contributors](https://github.com/tranhuucanh/fastqr/graphs/contributors)! 🎉
|
|
438
504
|
|
|
439
505
|
---
|
|
440
506
|
|
|
@@ -444,6 +510,8 @@ Special thanks to:
|
|
|
444
510
|
|
|
445
511
|
*If FastQR saves you time, give us a star!* ⭐
|
|
446
512
|
|
|
447
|
-
[
|
|
513
|
+
[](https://star-history.com/#tranhuucanh/fastqr&Date)
|
|
514
|
+
|
|
515
|
+
[⬆ Back to top](#fastqr)
|
|
448
516
|
|
|
449
|
-
</div>
|
|
517
|
+
</div>
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.27
|