fastqr 1.0.19 → 1.0.21
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/BUILD.md +10 -74
- data/CHANGELOG.md +1 -1
- data/CMakeLists.txt +1 -1
- data/DISTRIBUTION.md +14 -14
- data/INSTALL.md +4 -4
- data/LICENSE +1 -3
- data/PREBUILT.md +3 -3
- data/README.md +254 -148
- data/VERSION +1 -1
- data/bindings/nodejs/README.md +418 -0
- data/bindings/nodejs/package.json +1 -2
- data/bindings/ruby/extconf.rb +5 -5
- data/bindings/ruby/lib/fastqr/version.rb +1 -1
- data/bindings/ruby/prebuilt/linux-aarch64/bin/fastqr +0 -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.tar.gz +0 -0
- data/bindings/ruby/prebuilt/macos-arm64/bin/fastqr +0 -0
- data/bindings/ruby/prebuilt/macos-arm64.tar.gz +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64/bin/fastqr +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64.tar.gz +0 -0
- data/build.sh +5 -5
- data/docs/NODEJS_USAGE.md +2 -2
- data/docs/README.md +5 -4
- data/prebuilt/README.md +5 -6
- data/src/fastqr.cpp +1 -1
- metadata +5 -4
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
# FastQR
|
|
2
|
+
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://isocpp.org/)
|
|
5
|
+
[](https://en.wikipedia.org/wiki/C11_(C_standard_revision))
|
|
6
|
+
[](https://cmake.org/)
|
|
7
|
+
[](https://www.gnu.org/software/bash/)
|
|
8
|
+
[](https://www.ecma-international.org/ecma-262/)
|
|
9
|
+
[](https://rubygems.org/gems/fastqr)
|
|
10
|
+
[](https://www.npmjs.com/package/fastqr)
|
|
11
|
+
[](https://packagist.org/packages/fastqr/fastqr)
|
|
12
|
+
|
|
13
|
+
**The fastest QR code generator on the planet.** 🚀
|
|
14
|
+
|
|
15
|
+
Generate 1,000 QR codes in **0.37 seconds**. Full UTF-8 support. Custom colors. Logo embedding. Precise size control.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 🔥 Performance Benchmarks
|
|
20
|
+
|
|
21
|
+
### CLI Performance: FastQR vs qrencode
|
|
22
|
+
|
|
23
|
+
*Task: Generate 1,000 QR codes (500×500px)*
|
|
24
|
+
|
|
25
|
+
| Library | Sequential Mode | Batch Mode | Speedup |
|
|
26
|
+
|---------|----------------|------------|---------|
|
|
27
|
+
| **FastQR** | 2.56s 🚀 | **0.37s** ⚡ | **8x faster** with batch |
|
|
28
|
+
| qrencode | 2.97s 🐌 | ❌ Not supported | - |
|
|
29
|
+
|
|
30
|
+
**FastQR is 16% faster in sequential mode and 8x faster with batch mode!**
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### Ruby Performance: FastQR vs rqrcode
|
|
35
|
+
|
|
36
|
+
*Task: Generate 1,000 QR codes (500×500px)*
|
|
37
|
+
|
|
38
|
+
| Library | Sequential Mode | Batch Mode | Speedup |
|
|
39
|
+
|---------|----------------|------------|---------|
|
|
40
|
+
| **FastQR** | 3.49s 🚀 | **0.38s** ⚡ | **17x faster** with batch |
|
|
41
|
+
| rqrcode | 59.45s 🐢 | ❌ Not supported | - |
|
|
42
|
+
|
|
43
|
+
**FastQR is 17x faster in sequential mode and 157x faster with batch mode!**
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### Node.js Performance: FastQR vs qrcode
|
|
48
|
+
|
|
49
|
+
*Task: Generate 1,000 QR codes (500×500px)*
|
|
50
|
+
|
|
51
|
+
| Library | Sequential Mode | Batch Mode | Speedup |
|
|
52
|
+
|---------|----------------|------------|---------|
|
|
53
|
+
| **FastQR** | 2.43s 🚀 | **0.46s** ⚡ | **7x faster** with batch |
|
|
54
|
+
| qrcode | 17.25s 🐌 | ❌ Not supported | - |
|
|
55
|
+
|
|
56
|
+
**FastQR is 7x faster in sequential mode and 37x faster with batch mode!**
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 💪 Why FastQR Dominates
|
|
61
|
+
|
|
62
|
+
### Speed Comparison Summary
|
|
63
|
+
|
|
64
|
+
| Platform | Library | Sequential | Batch | FastQR Advantage |
|
|
65
|
+
|----------|---------|------------|-------|------------------|
|
|
66
|
+
| **CLI** | qrencode | 2.97s | ❌ | **8x faster** ⚡ |
|
|
67
|
+
| **Ruby** | rqrcode | 59.45s | ❌ | **157x faster** 🚀 |
|
|
68
|
+
| **Node.js** | qrcode | 17.25s | ❌ | **37x faster** ⚡ |
|
|
69
|
+
|
|
70
|
+
**Average: FastQR with batch mode is 67x faster than popular alternatives!**
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## ✨ What Makes FastQR Special?
|
|
75
|
+
|
|
76
|
+
### Features That Set Us Apart
|
|
77
|
+
|
|
78
|
+
| Feature | FastQR | Others |
|
|
79
|
+
|---------|--------|--------|
|
|
80
|
+
| **Batch Processing** | ✅ Up to 157x faster | ❌ Not available |
|
|
81
|
+
| **Exact Size Control** | ✅ 2000×2000px exact | ❌ Scale-based (imprecise) |
|
|
82
|
+
| **Full UTF-8 Support** | ✅ Vietnamese, Japanese, Chinese, emoji | ⚠️ Limited or none |
|
|
83
|
+
| **Custom Colors** | ✅ RGB foreground + background | ⚠️ Limited or none |
|
|
84
|
+
| **Logo Embedding** | ✅ Built-in logo support | ⚠️ Limited or none |
|
|
85
|
+
| **Language Bindings** | ✅ Ruby, Node.js, PHP, C++ | ✅ Usually supported |
|
|
86
|
+
| **Error Correction** | ✅ 4 levels (L, M, Q, H) | ✅ Usually supported |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 🚀 Key Features
|
|
91
|
+
|
|
92
|
+
- ⚡ **Blazing Fast**: Up to **157x faster** than popular alternatives with batch mode
|
|
93
|
+
- 🔥 **Batch Processing**: Generate 1,000 QR codes in **~0.37 seconds**
|
|
94
|
+
- 🌐 **Full UTF-8 Support**: Vietnamese, Japanese (Kanji, Hiragana, Katakana), Chinese, emoji, and more
|
|
95
|
+
- 🎨 **Custom Colors**: Choose any RGB color for QR code and background
|
|
96
|
+
- 📐 **Exact Size Control**: Generate QR codes with precise pixel dimensions (e.g., 2000×2000px)
|
|
97
|
+
- 🖼️ **Logo Embedding**: Add company logos to the center of QR codes
|
|
98
|
+
- 🛡️ **Error Correction**: Supports 4 levels (L, M, Q, H)
|
|
99
|
+
- 💾 **Multiple Formats**: PNG, JPG, WebP
|
|
100
|
+
- 🔧 **Multiple Languages**: Native bindings for Ruby, Node.js, PHP, and C++
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 📦 Installation
|
|
105
|
+
|
|
106
|
+
### CLI Installation
|
|
107
|
+
|
|
108
|
+
**macOS (Homebrew):**
|
|
109
|
+
```bash
|
|
110
|
+
brew tap tranhuucanh/fastqr
|
|
111
|
+
brew install fastqr
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Ubuntu/Debian:**
|
|
115
|
+
```bash
|
|
116
|
+
wget https://github.com/tranhuucanh/fastqr/releases/download/v1.0.0/fastqr-1.0.0-linux-x64.deb
|
|
117
|
+
sudo dpkg -i fastqr-1.0.0-linux-x64.deb
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Language Packages
|
|
121
|
+
|
|
122
|
+
**Ruby:**
|
|
123
|
+
```bash
|
|
124
|
+
gem install fastqr
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Node.js:**
|
|
128
|
+
```bash
|
|
129
|
+
npm install fastqr-pro
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**PHP:**
|
|
133
|
+
```bash
|
|
134
|
+
composer require fastqr/fastqr
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Build from Source
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Install dependencies
|
|
141
|
+
# macOS:
|
|
142
|
+
brew install qrencode libpng cmake
|
|
143
|
+
|
|
144
|
+
# Ubuntu/Debian:
|
|
145
|
+
sudo apt-get install libqrencode-dev libpng-dev cmake build-essential
|
|
146
|
+
|
|
147
|
+
# Build
|
|
148
|
+
git clone https://github.com/tranhuucanh/fastqr.git
|
|
149
|
+
cd fastqr
|
|
150
|
+
mkdir build && cd build
|
|
151
|
+
cmake ..
|
|
152
|
+
make
|
|
153
|
+
sudo make install
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
See [INSTALL.md](INSTALL.md) for more options.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🎯 Quick Start
|
|
161
|
+
|
|
162
|
+
### CLI
|
|
163
|
+
|
|
164
|
+
**Single QR Code:**
|
|
165
|
+
```bash
|
|
166
|
+
fastqr "Hello World" output.png
|
|
167
|
+
fastqr -s 500 -f 255,0,0 "Red QR" red.png
|
|
168
|
+
fastqr -l logo.png -L 25 "QR with Logo" branded.png
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Batch Mode (8x faster!):**
|
|
172
|
+
```bash
|
|
173
|
+
# Create batch.txt with one text per line
|
|
174
|
+
echo "https://example.com/user/1" > batch.txt
|
|
175
|
+
echo "https://example.com/user/2" >> batch.txt
|
|
176
|
+
# ... add 1000 URLs
|
|
177
|
+
|
|
178
|
+
# Generate 1,000 QR codes in 0.37 seconds ⚡
|
|
179
|
+
fastqr -F batch.txt output_dir/
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### Ruby
|
|
185
|
+
|
|
186
|
+
```ruby
|
|
187
|
+
require 'fastqr'
|
|
188
|
+
|
|
189
|
+
# Single QR code
|
|
190
|
+
FastQR.generate("Hello World", "qr.png", size: 500)
|
|
191
|
+
|
|
192
|
+
# Batch mode - 157x faster than rqrcode! 🚀
|
|
193
|
+
urls = (1..1000).map { |i| "https://example.com/user/#{i}" }
|
|
194
|
+
FastQR.generate_batch(urls, "output/")
|
|
195
|
+
# ⚡ Done in 0.38 seconds! (vs 59.45s with rqrcode)
|
|
196
|
+
|
|
197
|
+
# Custom colors and logo
|
|
198
|
+
FastQR.generate("https://example.com", "branded.png",
|
|
199
|
+
size: 800,
|
|
200
|
+
foreground: [255, 0, 0], # Red QR code
|
|
201
|
+
background: [255, 255, 200], # Light yellow background
|
|
202
|
+
logo: "logo.png",
|
|
203
|
+
logoSize: 20,
|
|
204
|
+
errorLevel: "H" # High error correction for logos
|
|
205
|
+
)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### Node.js
|
|
211
|
+
|
|
212
|
+
```javascript
|
|
213
|
+
const fastqr = require('fastqr');
|
|
214
|
+
|
|
215
|
+
// Single QR code
|
|
216
|
+
fastqr.generate('Hello World', 'qr.png', { size: 500 });
|
|
217
|
+
|
|
218
|
+
// Batch mode - 37x faster than qrcode! 🚀
|
|
219
|
+
const urls = Array.from({length: 1000}, (_, i) =>
|
|
220
|
+
`https://example.com/user/${i+1}`
|
|
221
|
+
);
|
|
222
|
+
fastqr.generateBatch(urls, 'output/');
|
|
223
|
+
// ⚡ Done in 0.46 seconds! (vs 17.25s with qrcode)
|
|
224
|
+
|
|
225
|
+
// Custom colors and logo
|
|
226
|
+
fastqr.generate('https://example.com', 'branded.png', {
|
|
227
|
+
size: 800,
|
|
228
|
+
foreground: [255, 0, 0], // Red QR code
|
|
229
|
+
background: [255, 255, 200], // Light yellow background
|
|
230
|
+
logo: 'logo.png',
|
|
231
|
+
logoSize: 20,
|
|
232
|
+
errorLevel: 'H' // High error correction for logos
|
|
233
|
+
});
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
### PHP
|
|
239
|
+
|
|
240
|
+
```php
|
|
241
|
+
use FastQR\FastQR;
|
|
242
|
+
|
|
243
|
+
// Single QR code
|
|
244
|
+
FastQR::generate('Hello World', 'qr.png', ['size' => 500]);
|
|
245
|
+
|
|
246
|
+
// Batch mode - Lightning fast! ⚡
|
|
247
|
+
$urls = array_map(fn($i) => "https://example.com/user/$i", range(1, 1000));
|
|
248
|
+
FastQR::generateBatch($urls, 'output/');
|
|
249
|
+
// Done in ~0.4 seconds!
|
|
250
|
+
|
|
251
|
+
// Custom colors and logo
|
|
252
|
+
FastQR::generate('https://example.com', 'branded.png', [
|
|
253
|
+
'size' => 800,
|
|
254
|
+
'foreground' => [255, 0, 0], // Red QR code
|
|
255
|
+
'background' => [255, 255, 200], // Light yellow background
|
|
256
|
+
'logo' => 'logo.png',
|
|
257
|
+
'logoSize' => 20,
|
|
258
|
+
'errorLevel' => 'H' // High error correction for logos
|
|
259
|
+
]);
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
### C++
|
|
265
|
+
|
|
266
|
+
```cpp
|
|
267
|
+
#include <fastqr.h>
|
|
268
|
+
|
|
269
|
+
// Single QR code
|
|
270
|
+
fastqr::QROptions options;
|
|
271
|
+
options.size = 500;
|
|
272
|
+
fastqr::generate("Hello World", "qr.png", options);
|
|
273
|
+
|
|
274
|
+
// Batch mode - Blazing fast! 🚀
|
|
275
|
+
std::vector<std::string> urls;
|
|
276
|
+
for (int i = 1; i <= 1000; i++) {
|
|
277
|
+
urls.push_back("https://example.com/user/" + std::to_string(i));
|
|
278
|
+
}
|
|
279
|
+
fastqr::generateBatch(urls, "output/", options);
|
|
280
|
+
// Done in ~0.4 seconds!
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## 📖 API Reference
|
|
286
|
+
|
|
287
|
+
### QROptions
|
|
288
|
+
|
|
289
|
+
| Option | Type | Default | Description |
|
|
290
|
+
|--------|------|---------|-------------|
|
|
291
|
+
| `size` | int | 300 | Output size in pixels (QR codes are square) |
|
|
292
|
+
| `optimizeSize` | bool | false | Auto round-up to nearest integer multiple |
|
|
293
|
+
| `foreground` | RGB array | [0,0,0] | QR code color (RGB) |
|
|
294
|
+
| `background` | RGB array | [255,255,255] | Background color (RGB) |
|
|
295
|
+
| `errorLevel` | string | 'M' | Error correction: L, M, Q, H |
|
|
296
|
+
| `logo` | string | "" | Path to logo image |
|
|
297
|
+
| `logoSize` | int | 20 | Logo size as percentage (1-50) |
|
|
298
|
+
| `quality` | int | 95 | Image quality for lossy formats (1-100) |
|
|
299
|
+
| `format` | string | 'png' | Output format: png, jpg, webp |
|
|
300
|
+
|
|
301
|
+
### Error Correction Levels
|
|
302
|
+
|
|
303
|
+
| Level | Recovery | Use Case |
|
|
304
|
+
|-------|----------|----------|
|
|
305
|
+
| **L (Low)** | ~7% | Maximum data capacity, clean environment |
|
|
306
|
+
| **M (Medium)** | ~15% | Balanced (default) |
|
|
307
|
+
| **Q (Quartile)** | ~25% | Good for QR codes with logos |
|
|
308
|
+
| **H (High)** | ~30% | Best for damaged/dirty environments |
|
|
309
|
+
|
|
310
|
+
Higher levels allow QR codes to remain readable when damaged or have logos embedded.
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 📚 Documentation
|
|
315
|
+
|
|
316
|
+
Complete usage guides for each platform:
|
|
317
|
+
|
|
318
|
+
- **[CLI Usage Guide](docs/CLI_USAGE.md)** - Complete command-line reference
|
|
319
|
+
- **[Ruby/Rails Usage Guide](docs/RUBY_USAGE.md)** - Ruby and Rails integration
|
|
320
|
+
- **[Node.js Usage Guide](docs/NODEJS_USAGE.md)** - Node.js, Express, and TypeScript
|
|
321
|
+
- **[PHP Usage Guide](docs/PHP_USAGE.md)** - PHP, Laravel, and WordPress integration
|
|
322
|
+
- **[Documentation Index](docs/README.md)** - Full documentation portal
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## 🏗️ Architecture
|
|
327
|
+
|
|
328
|
+
FastQR is built on battle-tested, industry-standard libraries:
|
|
329
|
+
|
|
330
|
+
- **[libqrencode](https://fukuchi.org/works/qrencode/)** (LGPL v2.1) - QR code bit matrix generation
|
|
331
|
+
- **[libpng](http://www.libpng.org/pub/png/libpng.html)** - Lightning-fast PNG encoding
|
|
332
|
+
- **[stb_image](https://github.com/nothings/stb)** (Public Domain) - Efficient image loading
|
|
333
|
+
|
|
334
|
+
**Why so fast?**
|
|
335
|
+
- ⚡ Zero process forking overhead
|
|
336
|
+
- 🚀 Optimized native C++ core
|
|
337
|
+
- 💪 Batch mode processes multiple QR codes in a single call
|
|
338
|
+
- 🔥 Efficient memory management and image encoding
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## 📄 License
|
|
343
|
+
|
|
344
|
+
FastQR is licensed under the **GNU Lesser General Public License v2.1 (LGPL-2.1)**.
|
|
345
|
+
|
|
346
|
+
### LGPL Requirements
|
|
347
|
+
|
|
348
|
+
When using FastQR in your projects:
|
|
349
|
+
|
|
350
|
+
1. **Open Source Projects**: Use freely ✅
|
|
351
|
+
2. **Closed Source/Commercial Projects**: Use as a library, but:
|
|
352
|
+
- Include a copy of the LGPL license
|
|
353
|
+
- State that your software uses FastQR
|
|
354
|
+
- Users must be able to replace FastQR with a modified version
|
|
355
|
+
|
|
356
|
+
See [LICENSE](LICENSE) for full details.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 🤝 Contributing
|
|
361
|
+
|
|
362
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
363
|
+
|
|
364
|
+
1. Fork the repository
|
|
365
|
+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
366
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
367
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
368
|
+
5. Open a Pull Request
|
|
369
|
+
|
|
370
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## 🐛 Bug Reports
|
|
375
|
+
|
|
376
|
+
Found a bug? Please open an issue with:
|
|
377
|
+
- Your OS and version
|
|
378
|
+
- FastQR version
|
|
379
|
+
- Steps to reproduce
|
|
380
|
+
- Expected vs actual behavior
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## 🗺️ Roadmap
|
|
385
|
+
|
|
386
|
+
- [ ] Windows support
|
|
387
|
+
- [ ] SVG output format
|
|
388
|
+
- [ ] Python bindings
|
|
389
|
+
- [ ] QR code scanning/decoding
|
|
390
|
+
- [ ] Advanced batch processing options
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## 📮 Contact
|
|
395
|
+
|
|
396
|
+
- **GitHub**: [@tranhuucanh](https://github.com/tranhuucanh)
|
|
397
|
+
- **Issues**: [GitHub Issues](https://github.com/tranhuucanh/fastqr/issues)
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## 🙏 Acknowledgments
|
|
402
|
+
|
|
403
|
+
Special thanks to:
|
|
404
|
+
- [libqrencode](https://fukuchi.org/works/qrencode/) by Kentaro Fukuchi
|
|
405
|
+
- [libpng](http://www.libpng.org/pub/png/libpng.html) by PNG Development Group
|
|
406
|
+
- [stb libraries](https://github.com/nothings/stb) by Sean Barrett
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
<div align="center">
|
|
411
|
+
|
|
412
|
+
**Made with ❤️ by FastQR Project**
|
|
413
|
+
|
|
414
|
+
*If FastQR saves you time, give us a star!* ⭐
|
|
415
|
+
|
|
416
|
+
[⬆ Back to top](#fastqr-)
|
|
417
|
+
|
|
418
|
+
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fastqr-pro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Fast QR code generator with UTF-8 support, custom colors, logo embedding, and precise size control",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"vietnamese",
|
|
18
18
|
"japanese",
|
|
19
19
|
"fast",
|
|
20
|
-
"vips",
|
|
21
20
|
"image"
|
|
22
21
|
],
|
|
23
22
|
"author": "FastQR Project",
|
data/bindings/ruby/extconf.rb
CHANGED
|
@@ -21,7 +21,7 @@ def check_prebuilt_binary
|
|
|
21
21
|
when /x86_64|x64/
|
|
22
22
|
'linux-x86_64'
|
|
23
23
|
when /arm64|aarch64/
|
|
24
|
-
'linux-
|
|
24
|
+
'linux-aarch64'
|
|
25
25
|
else
|
|
26
26
|
nil
|
|
27
27
|
end
|
|
@@ -64,8 +64,8 @@ unless have_library('qrencode')
|
|
|
64
64
|
abort "ERROR: libqrencode is required. Install it first."
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
unless have_library('
|
|
68
|
-
abort "ERROR:
|
|
67
|
+
unless have_library('png')
|
|
68
|
+
abort "ERROR: libpng is required. Install it first."
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
# Check for headers
|
|
@@ -73,8 +73,8 @@ unless have_header('qrencode.h')
|
|
|
73
73
|
abort "ERROR: qrencode.h not found"
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
unless have_header('
|
|
77
|
-
abort "ERROR:
|
|
76
|
+
unless have_header('png.h')
|
|
77
|
+
abort "ERROR: png.h not found"
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
# Add C++14 support
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/build.sh
CHANGED
|
@@ -49,16 +49,16 @@ if ! pkg-config --exists libqrencode; then
|
|
|
49
49
|
fi
|
|
50
50
|
echo "✅ libqrencode found: $(pkg-config --modversion libqrencode)"
|
|
51
51
|
|
|
52
|
-
if ! pkg-config --exists
|
|
53
|
-
echo "❌
|
|
52
|
+
if ! pkg-config --exists libpng; then
|
|
53
|
+
echo "❌ libpng not found. Install with:"
|
|
54
54
|
if [[ "$OS" == "macos" ]]; then
|
|
55
|
-
echo " brew install
|
|
55
|
+
echo " brew install libpng"
|
|
56
56
|
else
|
|
57
|
-
echo " sudo apt-get install
|
|
57
|
+
echo " sudo apt-get install libpng-dev"
|
|
58
58
|
fi
|
|
59
59
|
exit 1
|
|
60
60
|
fi
|
|
61
|
-
echo "✅
|
|
61
|
+
echo "✅ libpng found: $(pkg-config --modversion libpng)"
|
|
62
62
|
|
|
63
63
|
# Build
|
|
64
64
|
echo ""
|
data/docs/NODEJS_USAGE.md
CHANGED
|
@@ -5,13 +5,13 @@ Complete guide for using FastQR in Node.js and JavaScript applications.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install fastqr
|
|
8
|
+
npm install fastqr-pro
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Or with Yarn:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
yarn add fastqr
|
|
14
|
+
yarn add fastqr-pro
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
**Note:** No system dependencies required! Pre-built binaries are included. 🎉
|
data/docs/README.md
CHANGED
|
@@ -40,10 +40,10 @@ FastQR is a fast, powerful QR code generator with full UTF-8 support, custom col
|
|
|
40
40
|
### 📦 No Dependencies!
|
|
41
41
|
Starting from v1.0.0, all language packages include pre-built binaries:
|
|
42
42
|
- Ruby: `gem install fastqr` ✅
|
|
43
|
-
- Node.js: `npm install fastqr` ✅
|
|
43
|
+
- Node.js: `npm install fastqr-pro` ✅
|
|
44
44
|
- PHP: `composer require fastqr/fastqr` ✅
|
|
45
45
|
|
|
46
|
-
No need to install libqrencode
|
|
46
|
+
No need to install libqrencode separately!
|
|
47
47
|
|
|
48
48
|
## Quick Start
|
|
49
49
|
|
|
@@ -69,7 +69,7 @@ FastQR.generate("Hello World", "qr.png", width: 500, height: 500)
|
|
|
69
69
|
|
|
70
70
|
### Node.js
|
|
71
71
|
```javascript
|
|
72
|
-
npm install fastqr
|
|
72
|
+
npm install fastqr-pro
|
|
73
73
|
|
|
74
74
|
const fastqr = require('fastqr');
|
|
75
75
|
fastqr.generate('Hello World', 'qr.png', { width: 500, height: 500 });
|
|
@@ -160,7 +160,8 @@ fastqr -s 2000x2000 -q 100 -e H "SKU-12345" product_qr.png
|
|
|
160
160
|
|
|
161
161
|
FastQR is built on:
|
|
162
162
|
- **[libqrencode](https://fukuchi.org/works/qrencode/)** (LGPL v2.1) - QR code generation
|
|
163
|
-
- **[
|
|
163
|
+
- **[libpng](http://www.libpng.org/pub/png/libpng.html)** - PNG image encoding
|
|
164
|
+
- **[stb_image](https://github.com/nothings/stb)** (Public Domain) - Image loading
|
|
164
165
|
|
|
165
166
|
Pre-built binaries are automatically generated for:
|
|
166
167
|
- macOS (Intel & Apple Silicon)
|
data/prebuilt/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Pre-built binaries are automatically included in the gem and loaded via FFI.
|
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
50
|
gem install fastqr
|
|
51
|
-
# No need to install qrencode
|
|
51
|
+
# No need to install qrencode!
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
### For Node.js
|
|
@@ -56,8 +56,8 @@ gem install fastqr
|
|
|
56
56
|
Pre-built binaries are automatically included in the npm package.
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npm install fastqr
|
|
60
|
-
# No need to install qrencode
|
|
59
|
+
npm install fastqr-pro
|
|
60
|
+
# No need to install qrencode!
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
### For PHP
|
|
@@ -66,7 +66,7 @@ Pre-built binaries are included in the Composer package.
|
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
composer require fastqr/fastqr
|
|
69
|
-
# No need to install qrencode
|
|
69
|
+
# No need to install qrencode!
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
### Manual Installation
|
|
@@ -105,7 +105,7 @@ The bindings automatically detect your platform and load the appropriate binary:
|
|
|
105
105
|
|
|
106
106
|
## Notes
|
|
107
107
|
|
|
108
|
-
- Binaries are built with static linking of libqrencode
|
|
108
|
+
- Binaries are built with static linking of libqrencode
|
|
109
109
|
- No external dependencies required at runtime
|
|
110
110
|
- Binaries are built on GitHub Actions for consistency
|
|
111
111
|
- All binaries are tested before release
|
|
@@ -125,7 +125,6 @@ This will trigger the `build-binaries.yml` workflow which builds for all platfor
|
|
|
125
125
|
|
|
126
126
|
The pre-built binaries include statically linked libraries:
|
|
127
127
|
- libqrencode (LGPL 2.1)
|
|
128
|
-
- libvips (LGPL 2.1+)
|
|
129
128
|
|
|
130
129
|
As required by LGPL, users can rebuild with different versions. See BUILD.md for instructions.
|
|
131
130
|
|
data/src/fastqr.cpp
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastqr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.21
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- FastQR Project
|
|
@@ -52,8 +52,8 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '5.0'
|
|
55
|
-
description:
|
|
56
|
-
|
|
55
|
+
description: Generate 1,000 QR codes in **0.37 seconds**. Full UTF-8 support. Custom
|
|
56
|
+
colors. Logo embedding. Precise size control.
|
|
57
57
|
email:
|
|
58
58
|
- fastqr@example.com
|
|
59
59
|
executables: []
|
|
@@ -71,6 +71,7 @@ files:
|
|
|
71
71
|
- PREBUILT.md
|
|
72
72
|
- README.md
|
|
73
73
|
- VERSION
|
|
74
|
+
- bindings/nodejs/README.md
|
|
74
75
|
- bindings/nodejs/index.d.ts
|
|
75
76
|
- bindings/nodejs/index.js
|
|
76
77
|
- bindings/nodejs/lib/platform.js
|
|
@@ -158,5 +159,5 @@ requirements: []
|
|
|
158
159
|
rubygems_version: 3.4.19
|
|
159
160
|
signing_key:
|
|
160
161
|
specification_version: 4
|
|
161
|
-
summary:
|
|
162
|
+
summary: The fastest QR code generator on the planet.
|
|
162
163
|
test_files: []
|