展示HN:FastQR – 一款快速的C++二维码生成器,支持批量处理
我想分享一个名为 FastQR 的高性能二维码生成器(<a href="https://github.com/tranhuucanh/fastqr" rel="nofollow">https://github.com/tranhuucanh/fastqr</a>),它是用 C++ 编写的。这是我的第一个开源项目,我很兴奋(也有点紧张!)能与大家分享它。
<p>它是什么:
- 一个快速的命令行工具和库,用于生成二维码
- 用 C++ 编写,并支持 Ruby、PHP 和 Node.js 的绑定
- 完全支持 UTF-8(与越南语、日语及其他语言兼容良好)
- 支持自定义颜色、嵌入logo和精确的尺寸控制
- 包含预编译的二进制文件,无需单独安装依赖
<p>我为什么要构建这个:
- 我需要一个快速的二维码生成器,能够正确支持 UTF-8(尤其是越南文本),并且可以轻松集成到不同的语言中。大多数现有解决方案要么速度慢,要么对 Unicode 支持不佳。
<p>性能:
- 生成 100 个二维码(500x500 像素):约 0.3 秒
- 生成 1000 个二维码(500x500 像素):约 3 秒
- 批量模式比单个生成快 7 倍
<p>技术栈:
- 使用 libqrencode 和 libpng 的 C++ 核心
- Ruby、PHP 和 Node.js 的语言绑定
- 预编译的二进制文件,便于安装
<p>这是我第一次做开源项目,所以我相信还有很多可以改进的地方或者我未发现的bug。如果你能试用一下并分享你的反馈,我将非常感激。如果你发现任何问题或有建议,请在 GitHub 上提出问题,我会尽快修复。
<p>任何反馈、批评或建议都将不胜感激。感谢你花时间查看它!
<p>GitHub: <a href="https://github.com/tranhuucanh/fastqr" rel="nofollow">https://github.com/tranhuucanh/fastqr</a>
查看原文
I'd like to share FastQR (<a href="https://github.com/tranhuucanh/fastqr" rel="nofollow">https://github.com/tranhuucanh/fastqr</a>), a high-performance QR code generator written in C++. This is my first open-source project, and I'm excited (and a bit nervous!) to share it with you all.<p>What it is:
- A fast CLI tool and library for generating QR codes
- Written in C++ with bindings for Ruby, PHP, and Node.js
- Full UTF-8 support (works great with Vietnamese, Japanese, and other languages)
- Supports custom colors, logo embedding, and precise size control
- Pre-built binaries included – no need to install dependencies separately<p>Why I built this:
- I needed a QR code generator that was fast, supported UTF-8 properly (especially for Vietnamese text), and could be easily integrated into different languages. Most existing solutions were either slow or had poor Unicode support.<p>Performance:
- Generating 100 QR codes (500x500px): ~0.3 seconds
- Generating 1000 QR codes (500x500px): ~3 seconds
- Batch mode is 7x faster than individual generation<p>Tech stack:
- C++ core using libqrencode and libpng
- Language bindings for Ruby, PHP, and Node.js
- Precompiled binaries for easy installation<p>This is my very first open-source project, so I'm sure there are things that could be improved or bugs I haven't caught yet. I'd really appreciate it if you could try it out and share your feedback. If you find any issues or have suggestions, please open an issue on GitHub – I'll do my best to fix them quickly.<p>Any feedback, criticism, or suggestions would be greatly appreciated. Thanks for taking the time to check it out!<p>GitHub: <a href="https://github.com/tranhuucanh/fastqr" rel="nofollow">https://github.com/tranhuucanh/fastqr</a>